Created
August 31, 2019 19:03
-
-
Save splincode/9cdd6c5bba8360988d045db40a7fb22a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { State, Action } from '@ngxs/store'; | |
import { Increment, Decrement } from './count.actions'; | |
@State<number>({ | |
name: 'count', | |
defaults: 0 | |
}) | |
export class CountState { | |
@Action(Increment) public increment({ setState }) { | |
setState(state => ++state); | |
} | |
@Action(Decrement) public decrement({ setState }) { | |
setState(state => --state); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment