Skip to content

Instantly share code, notes, and snippets.

@stockwellb
Last active May 21, 2017 14:15
Show Gist options
  • Save stockwellb/52ac73ee8ca98c613f0a46fd189d0b51 to your computer and use it in GitHub Desktop.
Save stockwellb/52ac73ee8ca98c613f0a46fd189d0b51 to your computer and use it in GitHub Desktop.
ngrx code example for medium article
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