aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reducers/index.js
blob: ac592bfed755c1213702a58a88fd77714dafe1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const initialState = {
  devices: [],
  positions: [],
  events: []
};

function rootReducer(state = initialState, action) {
  switch (action.type) {
    case 'UPDATE_DEVICES':
      return Object.assign({}, {
        ...state,
        devices: [...action.devices]
      });
    case 'UPDATE_POSITIONS':
      return Object.assign({}, {
        ...state,
        positions: [...action.positions]
      });
    default:
      return state;
  }
}

export default rootReducer