Skip to content

Instantly share code, notes, and snippets.

@wojtek1150
Last active June 1, 2018 07:40
Show Gist options
  • Save wojtek1150/8b46b73bc1f1239809a374d0f2b1dd0b to your computer and use it in GitHub Desktop.
Save wojtek1150/8b46b73bc1f1239809a374d0f2b1dd0b to your computer and use it in GitHub Desktop.
import { Action } from '@ngrx/store';
export const LOAD_USERS = '[Users] Load Users'; // It's good practice to add namespace for each action module
export const LOAD_USERS_FAIL = '[Users] Load Users Fail';
export const LOAD_USERS_SUCCESS = '[Users] Load Users Success';
export class LoadUsers implements Action {
readonly type = LOAD_USERS;
}
export class LoadUsersFail implements Action {
readonly type = LOAD_USERS_FAIL;
constructor(public payload: any) {}
}
export class LoadUsersSuccess implements Action {
readonly type = LOAD_USERS_SUCCESS;
constructor(public payload: any) {}
}
// Action types
export type UsersAction = LoadUsers | LoadUsersFail | LoadUsersSuccess;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment