Last active
June 14, 2018 13:20
-
-
Save wesleygrimes/3f44710f040dd8c1f52a6b49b8135ecf to your computer and use it in GitHub Desktop.
Entity Feature Store Module - Actions
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 { MyModel } from '../../models'; | |
export enum ActionTypes { | |
LOAD_REQUEST = '[My Feature] Load Request', | |
LOAD_FAILURE = '[My Feature] Load Failure', | |
LOAD_SUCCESS = '[My Feature] Load Success' | |
} | |
export class LoadRequestAction implements Action { | |
readonly type = ActionTypes.LOAD_REQUEST; | |
} | |
export class LoadFailureAction implements Action { | |
readonly type = ActionTypes.LOAD_FAILURE; | |
constructor(public payload: { error: string }) {} | |
} | |
export class LoadSuccessAction implements Action { | |
readonly type = ActionTypes.LOAD_SUCCESS; | |
constructor(public payload: { items: MyModel[] }) {} | |
} | |
export type Actions = LoadRequestAction | LoadFailureAction | LoadSuccessAction; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment