UNPKG

piral-notifications

Version:

Plugin for triggering notifications in Piral.

14 lines 474 B
import { prependItem, excludeOn } from 'piral-core'; export function openNotification(ctx, dialog) { ctx.dispatch((state) => ({ ...state, notifications: prependItem(state.notifications, dialog), })); } export function closeNotification(ctx, dialog) { ctx.dispatch((state) => ({ ...state, notifications: excludeOn(state.notifications, (notification) => notification.id === dialog.id), })); } //# sourceMappingURL=actions.js.map