Skip to content

Instantly share code, notes, and snippets.

@ThrowJojo
Created September 19, 2017 03:55
Show Gist options
  • Save ThrowJojo/96cdd2bf251aed8648ef3c1d7c4a5029 to your computer and use it in GitHub Desktop.
Save ThrowJojo/96cdd2bf251aed8648ef3c1d7c4a5029 to your computer and use it in GitHub Desktop.
MobX store for a Counter.
// @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