member_webapp/@overflow/infra/store/detail/detail.action.ts
crusader d59d9379f9 ing
2018-05-24 15:44:13 +09:00

36 lines
769 B
TypeScript

import { Action } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc';
import { Infra } from '@overflow/commons-typescript/model/infra';
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
;