Created
June 26, 2020 16:37
-
-
Save kingsley-einstein/2256d09d9c80335eb0a26ff52fae4a8a to your computer and use it in GitHub Desktop.
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
import { Action } from '@ngrx/store'; | |
import { User } from '../../../models'; | |
export enum UserActionTypes { | |
LoadUserPing = '[User] Ping To Load User', | |
LoadUsersPing = '[User] Ping To Load Users', | |
LoadUser = '[User] Load A User', | |
LoadUsers = '[User] Load All Users' | |
} | |
export class LoadUserActionPing implements Action { | |
readonly type = UserActionTypes.LoadUserPing; | |
constructor(public payload: string) {} | |
} | |
export class LoadUsersActionPing implements Action { | |
readonly type = UserActionTypes.LoadUsersPing; | |
} | |
export class LoadUserAction implements Action { | |
readonly type = UserActionTypes.LoadUser; | |
constructor(public payload: { | |
data: User | |
}) { | |
} | |
} | |
export class LoadUsersAction implements Action { | |
readonly type = UserActionTypes.LoadUsers; | |
constructor(public payload: { | |
data: User[] | |
}) { | |
} | |
} | |
export type UserActionUnion = LoadUserAction | LoadUsersAction | LoadUserActionPing | LoadUsersActionPing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment