Skip to content

Instantly share code, notes, and snippets.

@splincode
Last active February 20, 2019 15:25
Show Gist options
  • Save splincode/384fd99fbcbceef0b0cadeeafedfaf38 to your computer and use it in GitHub Desktop.
Save splincode/384fd99fbcbceef0b0cadeeafedfaf38 to your computer and use it in GitHub Desktop.
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