member_webapp/src/packages/discovery/store/setting/setting.action.ts

43 lines
1018 B
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import { Action } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { DiscoveryStartInfo } from '../../model';
export enum ActionType {
Setting = '[discovery.setting] Setting',
SettingSuccess = '[discovery.setting] SettingSuccess',
SettingFailure = '[discovery.setting] SettingFailure',
SettingRedirect = '[discovery.setting] SettingRedirect',
}
export class Setting implements Action {
readonly type = ActionType.Setting;
constructor(public payload: DiscoveryStartInfo) {}
}
export class SettingSuccess implements Action {
readonly type = ActionType.SettingSuccess;
constructor(public payload: DiscoveryStartInfo) {}
}
export class SettingFailure implements Action {
readonly type = ActionType.SettingFailure;
constructor(public payload: RPCClientError) {}
}
export class SettingRedirect implements Action {
readonly type = ActionType.SettingRedirect;
}
export type Actions =
| Setting
| SettingSuccess
| SettingFailure
| SettingRedirect
;