Skip to content

Instantly share code, notes, and snippets.

@borie88
Created October 4, 2019 15:13
Show Gist options
  • Save borie88/4f25bb161e8833bda655a56017dbd203 to your computer and use it in GitHub Desktop.
Save borie88/4f25bb161e8833bda655a56017dbd203 to your computer and use it in GitHub Desktop.
Mobx Store in WeChat Mini Program Project
import { observable, action } from 'mobx-miniprogram'
export const store = observable({
// state
counter: 0,
// actions
increment: action(function () {
this.counter++
}),
decrement: action(function () {
this.counter--
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment