Skip to content

Instantly share code, notes, and snippets.

@AustinMatherne
Created September 29, 2017 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AustinMatherne/68be1a15e7cd4c1ce5af6a6d91e73e96 to your computer and use it in GitHub Desktop.
Save AustinMatherne/68be1a15e7cd4c1ce5af6a6d91e73e96 to your computer and use it in GitHub Desktop.
Const Typed Actions
// counter.actions.ts
import { Action } from '@ngrx/store';
export const INCREMENT = '[Counter] Increment';
export const DECREMENT = '[Counter] Decrement';
export const RESET = '[Counter] Reset';
export class Increment implements Action {
readonly type = INCREMENT;
}
export class Decrement implements Action {
readonly type = DECREMENT;
}
export class Reset implements Action {
readonly type = RESET;
constructor(public payload: number) {}
}
export type All
= Increment
| Decrement
| Reset;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment