(notification)
| 26 | export const HIDE_CONFIRM = 'HIDE_CONFIRM' |
| 27 | |
| 28 | export const enqueueSnackbar = (notification) => { |
| 29 | const key = notification.options && notification.options.key |
| 30 | |
| 31 | return { |
| 32 | type: ENQUEUE_SNACKBAR, |
| 33 | notification: { |
| 34 | ...notification, |
| 35 | options: { |
| 36 | ...notification.options, |
| 37 | persist: notification.options?.persist ?? false, // Default: auto-close enabled |
| 38 | autoHideDuration: notification.options?.autoHideDuration ?? 5000 // Default auto-close duration: 5 seconds |
| 39 | }, |
| 40 | key: key || new Date().getTime() + Math.random() |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | export const closeSnackbar = (key) => ({ |
| 46 | type: CLOSE_SNACKBAR, |
no test coverage detected