Skip to content

Instantly share code, notes, and snippets.

@splincode
Created January 2, 2019 14:09
Show Gist options
  • Save splincode/0a7b5d3c1f4fb1a1f3099c3460897c6f to your computer and use it in GitHub Desktop.
Save splincode/0a7b5d3c1f4fb1a1f3099c3460897c6f to your computer and use it in GitHub Desktop.
counter.ts
@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