38 lines
750 B
TypeScript
38 lines
750 B
TypeScript
import { Action } from '@ngrx/store';
|
|
|
|
import { RPCClientError } from '@loafer/ng-rpc/protocol';
|
|
|
|
import { Probe } from '../../model';
|
|
|
|
|
|
export enum ActionType {
|
|
Read = '[probe.detail] Read',
|
|
ReadSuccess = '[probe.detail] ReadSuccess',
|
|
ReadFailure = '[probe.detail] ReadFailure',
|
|
}
|
|
|
|
export class Read implements Action {
|
|
readonly type = ActionType.Read;
|
|
|
|
constructor(public payload: {id: string}) {}
|
|
}
|
|
|
|
export class ReadSuccess implements Action {
|
|
readonly type = ActionType.ReadSuccess;
|
|
|
|
constructor(public payload: Probe) {}
|
|
}
|
|
|
|
export class ReadFailure implements Action {
|
|
readonly type = ActionType.ReadFailure;
|
|
|
|
constructor(public payload: RPCClientError) {}
|
|
}
|
|
|
|
|
|
export type Actions =
|
|
| Read
|
|
| ReadSuccess
|
|
| ReadFailure
|
|
;
|