summaryrefslogtreecommitdiff
path: root/frontend/src/redux/errors.js
blob: 1c2479558f3ad24a9feeb2fefb34e737ef6fd564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Immutable from 'seamless-immutable'

export const types = {
  ERROR_RECEIVED_ON_WS: 'ERROR/RECEIVED_ON_WS',
}

export const actions = {
  errorReceived: (error) => ({
    type: types.ERROR_RECEIVED_ON_WS,
    error
  })
}

const initialState = Immutable.from([])

export default (state = initialState, action) => {
  switch (action.type) {
    case types.ERROR_RECEIVED_ON_WS:
      return state.concat([ action.error ])
    default:
      return state
  }
}
bgstack15