hyper/lib/actions/notifications.ts

19 lines
450 B
TypeScript
Raw Normal View History

import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../constants/notifications';
2020-01-02 09:27:27 -09:00
import {HyperActions} from '../hyper';
2016-07-13 12:44:24 -08:00
2020-01-02 09:27:27 -09:00
export function dismissNotification(id: string): HyperActions {
2016-07-13 12:44:24 -08:00
return {
type: NOTIFICATION_DISMISS,
id
};
}
2020-01-02 09:27:27 -09:00
export function addNotificationMessage(text: string, url: string | null = null, dismissable = true): HyperActions {
return {
type: NOTIFICATION_MESSAGE,
text,
url,
dismissable
};
}