Last active
May 21, 2017 14:15
-
-
Save stockwellb/52ac73ee8ca98c613f0a46fd189d0b51 to your computer and use it in GitHub Desktop.
ngrx code example for medium article
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
import { Action } from ‘@ngrx/store’; | |
import { Rate } from ‘../models/models’; | |
import { type } from '../util'; | |
export const ActionTypes = { | |
LOAD: type(‘LOAD’), | |
LOAD_SUCCESS: type(‘LOAD_SUCCESS’) | |
} | |
export class SetAction implements Action { | |
readonly type = ActionTypes.LOAD; | |
} | |
export class LoadAction implements Action { | |
readonly type = ActionTypes.LOAD_SUCCESS; | |
constructor(public payload: Rate[]) { | |
} | |
} | |
export type Actions = LoadAction | LoadSuccessAction; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment