2018-10-24 03:23:11 -05:00
|
|
|
import { AppNotification } from 'app/types/';
|
2018-10-23 06:34:27 -05:00
|
|
|
|
|
|
|
export enum ActionTypes {
|
|
|
|
AddAppNotification = 'ADD_APP_NOTIFICATION',
|
|
|
|
ClearAppNotification = 'CLEAR_APP_NOTIFICATION',
|
|
|
|
}
|
|
|
|
|
|
|
|
interface AddAppNotificationAction {
|
|
|
|
type: ActionTypes.AddAppNotification;
|
|
|
|
payload: AppNotification;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ClearAppNotificationAction {
|
|
|
|
type: ActionTypes.ClearAppNotification;
|
2018-10-23 09:00:04 -05:00
|
|
|
payload: number;
|
2018-10-23 06:34:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export type Action = AddAppNotificationAction | ClearAppNotificationAction;
|
|
|
|
|
2018-10-23 09:00:04 -05:00
|
|
|
export const clearAppNotification = (appNotificationId: number) => ({
|
2018-10-23 06:34:27 -05:00
|
|
|
type: ActionTypes.ClearAppNotification,
|
2018-10-23 09:00:04 -05:00
|
|
|
payload: appNotificationId,
|
2018-10-23 06:34:27 -05:00
|
|
|
});
|
|
|
|
|
2018-10-24 07:33:53 -05:00
|
|
|
export const notifyApp = (appNotification: AppNotification) => ({
|
2018-10-23 06:34:27 -05:00
|
|
|
type: ActionTypes.AddAppNotification,
|
2018-10-24 07:33:53 -05:00
|
|
|
payload: appNotification,
|
2018-10-23 06:34:27 -05:00
|
|
|
});
|