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

export { actions as calendarsActions };
export { reducer as calendarsReducer };