2018-04-06 11:02:18 +00:00
|
|
|
import { Action } from '@ngrx/store';
|
|
|
|
|
|
|
|
import { RPCClientError } from '@loafer/ng-rpc/protocol';
|
|
|
|
|
2018-05-02 08:09:39 +00:00
|
|
|
import { DiscoveryStartInfo } from '@overflow/commons-typescript/model/discovery';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
;
|