Skip to content

Instantly share code, notes, and snippets.

@daniele-zurico
Created June 19, 2018 18:11
Show Gist options
  • Save daniele-zurico/4ca73a71105e8977e22959bdc83fac1e to your computer and use it in GitHub Desktop.
Save daniele-zurico/4ca73a71105e8977e22959bdc83fac1e to your computer and use it in GitHub Desktop.
export enum HeroesActionTypes {
FetchHeroes = '[Heroes] Fetch Heroes',
FetchHeroesSuccess = '[Heroes] Load Heroes Success',
FetchHeroesError = '[Heroes] Load Heroes Error',
ChangePage = '[Heroes] Change page'
}
export enum Pagination {
NEXT,
PREV
}
export class FetchHeroes implements Action {
readonly type = HeroesActionTypes.FetchHeroes;
}
export class FetchHeroesSuccess implements Action {
readonly type = HeroesActionTypes.FetchHeroesSuccess;
constructor(public payload: HeroesResponse) {}
}
export class FetchHeroesError implements Action {
readonly type = HeroesActionTypes.FetchHeroesError;
constructor(public payload: HttpErrorResponse) {}
}
export class ChangePage implements Action {
readonly type = HeroesActionTypes.ChangePage;
constructor(public payload: Pagination) {}
}
export type HeroesActions = FetchHeroes | FetchHeroesSuccess | FetchHeroesError | ChangePage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment