member_webapp/src/packages/probe/store/probe-host/probe-host.action.ts

38 lines
883 B
TypeScript
Raw Normal View History

2018-04-25 09:04:47 +00:00
import { Action } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
2018-05-02 08:09:39 +00:00
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
2018-04-25 09:04:47 +00:00
export enum ActionType {
ReadByProbe = '[probeHost.detail] Read',
ReadByProbeSuccess = '[probeHost.detail] ReadSuccess',
ReadByProbeFailure = '[probeHost.detail] ReadFailure',
}
export class ReadByProbe implements Action {
readonly type = ActionType.ReadByProbe;
constructor(public payload: Probe) {}
}
export class ReadByProbeSuccess implements Action {
readonly type = ActionType.ReadByProbeSuccess;
constructor(public payload: ProbeHost) {}
}
export class ReadByProbeFailure implements Action {
readonly type = ActionType.ReadByProbeFailure;
constructor(public payload: RPCClientError) {}
}
export type Actions =
| ReadByProbe
| ReadByProbeSuccess
| ReadByProbeFailure
;