Created
June 19, 2018 18:11
-
-
Save daniele-zurico/4ca73a71105e8977e22959bdc83fac1e to your computer and use it in GitHub Desktop.
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
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