Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 5 | Rev 1668 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 5 Rev 1506
Línea 1... Línea 1...
1
import { v1 } from 'uuid'
1
import { v4 as uuid } from 'uuid'
2
import { notificationActionTypes } from './notification.types'
2
import { notificationActionTypes } from './notification.types'
Línea 3... Línea 3...
3
 
3
 
4
const NotificationInitialState = {
4
const NotificationInitialState = {
5
  notifications: []
5
  notifications: []
Línea 9... Línea 9...
9
  state = NotificationInitialState,
9
  state = NotificationInitialState,
10
  { type, payload }
10
  { type, payload }
11
) => {
11
) => {
12
  switch (type) {
12
  switch (type) {
13
    case notificationActionTypes.ADD_NOTIFICATION:
13
    case notificationActionTypes.ADD_NOTIFICATION:
14
      const newNotification = { ...payload, id: v1() }
14
      const newNotification = { ...payload, id: uuid() }
15
      return {
15
      return {
16
        ...state,
16
        ...state,
17
        notifications: [newNotification, ...state.notifications]
17
        notifications: [newNotification, ...state.notifications]
18
      }
18
      }
19
    case notificationActionTypes.REMOVE_NOTIFICATION:
19
    case notificationActionTypes.REMOVE_NOTIFICATION: