sharyn
Version:
Combines all the other packages under one.
17 lines (13 loc) • 501 B
Flow
// @flow
export const addOneNotification = (uiState: Object, notification?: Object) => ({
...uiState,
notifications: [...uiState.notifications, ...(notification ? [notification] : [])],
})
export const addMultipleNotifications = (uiState: Object, notifications?: Object[] = []) => ({
...uiState,
notifications: [...uiState.notifications, ...notifications],
})
export const removeFirstNotification = (uiState: Object) => ({
...uiState,
notifications: uiState.notifications.splice(1),
})