0.1.0 • Published 3 years ago
@wiredcraft/miniprogram-sparrow v0.1.0
Install
yarn add @wiredcraft/miniprogram-sparrow
Usage
// 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");
},
},
});
0.1.0
3 years ago
0.0.6-rc.0
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.5-rc.1
3 years ago
0.0.3
3 years ago