Created
January 2, 2019 14:09
-
-
Save splincode/0a7b5d3c1f4fb1a1f3099c3460897c6f to your computer and use it in GitHub Desktop.
counter.ts
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
@State<number>({ | |
name: 'counter', | |
defaults: 0 | |
}) | |
export class CounterState { | |
@Action(Increment) | |
public increment({ setState }: StateContext<number>) { | |
setState((state) => state++); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment