update doNotify and add doHideNotification
This commit is contained in:
parent
800083dc24
commit
c278824b3d
8 changed files with 8641 additions and 34 deletions
src/redux/selectors
|
@ -2,7 +2,29 @@ import { createSelector } from 'reselect';
|
|||
|
||||
export const selectState = state => state.notifications || {};
|
||||
|
||||
export const selectNotification = createSelector(
|
||||
export const selectNotificationData = createSelector(
|
||||
selectState,
|
||||
state => (state.queue.length > 0 ? state.queue[0] : {})
|
||||
);
|
||||
|
||||
export const selectNotification = createSelector(
|
||||
selectNotificationData,
|
||||
notificationData => notificationData.notification
|
||||
);
|
||||
|
||||
export const selectNotificationProps = createSelector(
|
||||
selectNotificationData,
|
||||
notificationData => notificationData.notificationProps
|
||||
);
|
||||
|
||||
export const selectSnack = createSelector(
|
||||
// No props for snackbar
|
||||
selectNotification,
|
||||
notification => {
|
||||
if (notification && notification.displayType) {
|
||||
return notification.displayType.indexOf('snackbar') > -1 ? notification : undefined;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue