miniprogram-sparrow 0.1.1
Install from the command line:
Learn more about npm packages
$ npm install @wiredcraft/miniprogram-sparrow@0.1.1
Install via package.json:
"@wiredcraft/miniprogram-sparrow": "0.1.1"
About this version
yarn add @wiredcraft/miniprogram-sparrow
// store/name.js
import { atom } from "sparrow";
export const firstName = atom("Jack");
// the action
export function updateFirstName(name) {
write(firstName, name);
}
// components/hello.js
import { write, behavior as sparrow } from "sparrow";
import { firstName, updateFirstName } from "./store/name";
Component({
atoms: { firstName },
behaviors: [sparrow],
lifetimes: {
attached() {
console.log(this.firstName);
},
},
methods: {
handleButtonOnTap() {
updateFirstName("Rose");
},
},
});
to NPM & GPM(GITHUB Package Registry)
Details
- miniprogram-sparrow
- Wiredcraft
- over 1 year ago
- MIT
- 8 dependencies
Assets
- miniprogram-sparrow-0.1.1.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0