Last active
February 20, 2019 15:25
-
-
Save splincode/384fd99fbcbceef0b0cadeeafedfaf38 to your computer and use it in GitHub Desktop.
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
export class Increment { | |
static readonly type = '[Increment]: description'; | |
} | |
@State<number>({ | |
name: 'count', | |
defaults: 0 | |
}) | |
export class CountState { | |
@Action(Increment) | |
public increment({ getState, setState }) { | |
const state = getState(); | |
setState(state + 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment