Last active
May 30, 2018 18:34
-
-
Save wesleygrimes/d7b660caedb80a35213dd55e8c63a9d5 to your computer and use it in GitHub Desktop.
Standard 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 { User } from '../../models'; | |
export enum ActionTypes { | |
LOGIN_REQUEST = '[My Feature] Login Request', | |
LOGIN_FAILURE = '[My Feature] Login Failure', | |
LOGIN_SUCCESS = '[My Feature] Login Success' | |
} | |
export class LoginRequestAction implements Action { | |
readonly type = ActionTypes.LOGIN_REQUEST; | |
constructor(public payload: { userName: string; password: string }) {} | |
} | |
export class LoginFailureAction implements Action { | |
readonly type = ActionTypes.LOGIN_FAILURE; | |
constructor(public payload: { error: string }) {} | |
} | |
export class LoginSuccessAction implements Action { | |
readonly type = ActionTypes.LOGIN_SUCCESS; | |
constructor(public payload: { user: User }) {} | |
} | |
export type Actions = LoginRequestAction | LoginFailureAction | LoginSuccessAction; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment