Skip to content

Instantly share code, notes, and snippets.

@kingsley-einstein
Created June 26, 2020 16:37
Show Gist options
  • Save kingsley-einstein/2256d09d9c80335eb0a26ff52fae4a8a to your computer and use it in GitHub Desktop.
Save kingsley-einstein/2256d09d9c80335eb0a26ff52fae4a8a to your computer and use it in GitHub Desktop.
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