Skip to content

miniprogram-sparrow 0.1.0

Install from the command line:
Learn more about npm packages
$ npm install @wiredcraft/miniprogram-sparrow@0.1.0
Install via package.json:
"@wiredcraft/miniprogram-sparrow": "0.1.0"

About this version

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");
    },
  },
});

Details


Assets

  • miniprogram-sparrow-0.1.0.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all