aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/drivers.js
blob: 38933d8401acb30f4bcb1e59bb96d42ae5038e0d (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: 'drivers',
  initialState: {
    items: {},
  },
  reducers: {
    update(state, action) {
      action.payload.forEach((item) => state.items[item.id] = item);
    },
  },
});

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