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