diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-04-20 12:15:13 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-04-20 12:15:13 +0530 |
commit | 2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b (patch) | |
tree | 3e352b219ccfa178ca7f678d6a434a104bfdd987 /modern/src/store/drivers.js | |
parent | 047bf86480e2b3e215c13df2af0da456a664b507 (diff) | |
download | trackermap-web-2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b.tar.gz trackermap-web-2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b.tar.bz2 trackermap-web-2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b.zip |
Created mostly used stores
Diffstat (limited to 'modern/src/store/drivers.js')
-rw-r--r-- | modern/src/store/drivers.js | 16 |
1 files changed, 16 insertions, 0 deletions
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 }; |