Created
October 4, 2019 15:13
-
-
Save borie88/4f25bb161e8833bda655a56017dbd203 to your computer and use it in GitHub Desktop.
Mobx Store in WeChat Mini Program Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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