From 2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b Mon Sep 17 00:00:00 2001 From: Ashutosh Bishnoi Date: Tue, 20 Apr 2021 12:15:13 +0530 Subject: Created mostly used stores --- modern/src/store/calendars.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modern/src/store/calendars.js (limited to 'modern/src/store/calendars.js') diff --git a/modern/src/store/calendars.js b/modern/src/store/calendars.js new file mode 100644 index 0000000..3aa4d89 --- /dev/null +++ b/modern/src/store/calendars.js @@ -0,0 +1,16 @@ +import { createSlice } from '@reduxjs/toolkit'; + +const { reducer, actions } = createSlice({ + name: 'calendars', + initialState: { + items: {}, + }, + reducers: { + update(state, action) { + action.payload.forEach(item => state.items[item['id']] = item); + }, + } +}); + +export { actions as calendarsActions }; +export { reducer as calendarsReducer }; -- cgit v1.2.3