aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/positions.js
blob: 8858298d305fcf0bfe61127d436dceae2a29b390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { createSlice } from '@reduxjs/toolkit';

const { reducer, actions } = createSlice({
  name: 'positions',
  initialState: {
    items: {},
  },
  reducers: {
    update(state, action) {
      action.payload.forEach((item) => state.items[item.deviceId] = item);
    },
  },
});

export { actions as positionsActions };
export { reducer as positionsReducer };