import { Action } from '@ngrx/store' ; import { Hero } from '../../core' ; export const LOAD_HEROES = '[Heroes] Load Heroes' ; export const LOAD_HEROES_SUCCESS = '[Heroes] Load Heroes Success' ; export const LOAD_HEROES_ERROR = '[Heroes] Load Heroes Error' ; export const ADD_HERO = '[Heroes] Add Hero' ; export const ADD_HERO_SUCCESS = '[Heroes] Add Hero Success' ; export const ADD_HERO_ERROR = '[Heroes] Add Heroes Error' ; export const DELETE_HERO = '[Heroes] Delete Hero' ; export const DELETE_HERO_SUCCESS = '[Heroes] Delete Hero Success' ; export const DELETE_HERO_ERROR = '[Heroes] Delete Hero Error' ; export const UPDATE_HERO = '[Heroes] Update Hero' ; export const UPDATE_HERO_SUCCESS = '[Heroes] Update Hero Success' ; export const UPDATE_HERO_ERROR = '[Heroes] Update Hero Error' ; export interface HeroAction extends Action { payload ? : any ; } export class LoadHeroes implements HeroAction { readonly type = LOAD_HEROES ; } export class LoadHeroesSuccess implements HeroAction { readonly type = LOAD_HEROES_SUCCESS ; constructor ( public payload ) { } } export class LoadHeroesError implements HeroAction { readonly type = LOAD_HEROES_ERROR ; constructor ( public payload ) { } } export class AddHero implements HeroAction { readonly type = ADD_HERO ; constructor ( public payload ) { } } export class AddHeroSuccess implements HeroAction { readonly type = ADD_HERO_SUCCESS ; constructor ( public payload ) { } } export class AddHeroError implements HeroAction { readonly type = ADD_HERO_ERROR ; constructor ( public payload ) { } } export class DeleteHero implements HeroAction { readonly type = DELETE_HERO ; constructor ( public payload ) { } } export class DeleteHeroSuccess implements HeroAction { readonly type = DELETE_HERO_SUCCESS ; } export class DeleteHeroError implements HeroAction { readonly type = DELETE_HERO_ERROR ; constructor ( public payload ) { } } export class UpdateHero implements HeroAction { readonly type = UPDATE_HERO ; constructor ( public payload ) { } } export class UpdateHeroSuccess implements HeroAction { readonly type = UPDATE_HERO_SUCCESS ; constructor ( public payload ) { } } export class UpdateHeroError implements HeroAction { readonly type = UPDATE_HERO_ERROR ; constructor ( public payload ) { } } /** Union type of all Hero Action Creator classes */ export type HeroActions = LoadHeroes | LoadHeroesSuccess | LoadHeroesError | AddHero | AddHeroSuccess | AddHeroError | DeleteHero | DeleteHeroSuccess | DeleteHeroError | UpdateHero | UpdateHeroSuccess | UpdateHeroError ;