2018-04-19 10:26:39 +00:00
|
|
|
import { Action } from '@ngrx/store';
|
2018-05-24 06:44:13 +00:00
|
|
|
import { RPCClientError } from '@loafer/ng-rpc';
|
2018-05-02 08:09:39 +00:00
|
|
|
import { Infra } from '@overflow/commons-typescript/model/infra';
|
2018-04-19 10:26:39 +00:00
|
|
|
|
|
|
|
export enum ActionType {
|
|
|
|
Read = '[Infra.list] Read',
|
|
|
|
ReadSuccess = '[Infra.list] ReadSuccess',
|
|
|
|
ReadFailure = '[Infra.list] 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: Infra) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ReadFailure implements Action {
|
|
|
|
readonly type = ActionType.ReadFailure;
|
|
|
|
|
|
|
|
constructor(public payload: RPCClientError) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type Actions =
|
|
|
|
| Read
|
|
|
|
| ReadSuccess
|
|
|
|
| ReadFailure
|
|
|
|
;
|