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

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

export { actions as driversActions };
export { reducer as driversReducer };