Created
September 29, 2017 05:00
-
-
Save AustinMatherne/68be1a15e7cd4c1ce5af6a6d91e73e96 to your computer and use it in GitHub Desktop.
Const Typed Actions
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
// 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