Created
September 19, 2017 03:55
-
-
Save ThrowJojo/96cdd2bf251aed8648ef3c1d7c4a5029 to your computer and use it in GitHub Desktop.
MobX store for a Counter.
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
// @flow | |
import { observable, action } from "mobx"; | |
export default class CounterStore { | |
@observable count = 0; | |
@action increase() { | |
this.count += 1; | |
} | |
@action decrease() { | |
this.count -= 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment