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/drivers.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modern/src/store/drivers.js (limited to 'modern/src/store/drivers.js') diff --git a/modern/src/store/drivers.js b/modern/src/store/drivers.js new file mode 100644 index 00000000..63522d78 --- /dev/null +++ b/modern/src/store/drivers.js @@ -0,0 +1,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 }; -- cgit v1.2.3