member_webapp/@overflow/notification/store/detail/notification.action.ts

62 lines
1.9 KiB
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import { Action } from '@ngrx/store';
2018-05-24 06:44:13 +00:00
import { RPCClientError } from '@loafer/ng-rpc';
2018-04-06 11:02:18 +00:00
2018-05-02 08:09:39 +00:00
import { Member } from '@overflow/commons-typescript/model/member';
2018-05-24 06:44:13 +00:00
// import { PageParams, Page } from 'app/commons/model';
2018-05-02 08:09:39 +00:00
import { Notification } from '@overflow/commons-typescript/model/notification';
2018-04-06 11:02:18 +00:00
export enum ActionType {
MarkAsRead = '[Notification.notification] MarkAsRead',
MarkAsReadSuccess = '[Notification.notification] MarkAsReadSuccess',
MarkAsReadFailure = '[Notification.notification] MarkAsReadFailure',
// ReadUnconfirmedCount = '[Notification.notification] ReadUnconfirmedCount',
// ReadUnconfirmedCountSuccess = '[Notification.notification] ReadUnconfirmedCountSuccess',
// ReadUnconfirmedCountFailure = '[Notification.notification] ReadUnconfirmedCountFailure',
}
export class MarkAsRead implements Action {
readonly type = ActionType.MarkAsRead;
constructor(public payload: Notification ) {}
}
export class MarkAsReadSuccess implements Action {
readonly type = ActionType.MarkAsReadSuccess;
constructor(public payload: Notification) {}
}
export class MarkAsReadFailure implements Action {
readonly type = ActionType.MarkAsReadFailure;
constructor(public payload: RPCClientError) {}
}
// export class ReadUnconfirmedCount implements Action {
// readonly type = ActionType.ReadUnconfirmedCount;
// constructor(public payload: Member) {}
// }
// export class ReadUnconfirmedCountSuccess implements Action {
// readonly type = ActionType.ReadUnconfirmedCountSuccess;
// constructor(public payload: number) {}
// }
// export class ReadUnconfirmedCountFailure implements Action {
// readonly type = ActionType.ReadUnconfirmedCountFailure;
// constructor(public payload: RPCClientError) {}
// }
export type Actions =
| MarkAsRead
| MarkAsReadSuccess
| MarkAsReadFailure
// | ReadUnconfirmedCount
// | ReadUnconfirmedCountSuccess
// | ReadUnconfirmedCountFailure
;