aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/drivers.js
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-04-20 12:15:13 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-04-20 12:15:13 +0530
commit2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b (patch)
tree3e352b219ccfa178ca7f678d6a434a104bfdd987 /modern/src/store/drivers.js
parent047bf86480e2b3e215c13df2af0da456a664b507 (diff)
downloadtrackermap-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.js16
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 };