aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/positions.js
diff options
context:
space:
mode:
authorditoaugusta <dt_ap@ymail.com>2020-03-25 00:24:33 +0700
committerditoaugusta <dt_ap@ymail.com>2020-03-25 00:24:33 +0700
commit506fe663e2e3b9ffe9764f5c06b04524c4793534 (patch)
tree592318f13ce3d2e66294d95bb2b603cd20b43735 /modern/src/store/positions.js
parent2f8ae58f4f5cde892b4b6981a83a37edc1422a2c (diff)
downloadtrackermap-web-506fe663e2e3b9ffe9764f5c06b04524c4793534.tar.gz
trackermap-web-506fe663e2e3b9ffe9764f5c06b04524c4793534.tar.bz2
trackermap-web-506fe663e2e3b9ffe9764f5c06b04524c4793534.zip
delete module subfolder. edit relative path.
Diffstat (limited to 'modern/src/store/positions.js')
-rw-r--r--modern/src/store/positions.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modern/src/store/positions.js b/modern/src/store/positions.js
new file mode 100644
index 00000000..1df468cd
--- /dev/null
+++ b/modern/src/store/positions.js
@@ -0,0 +1,16 @@
+import { createSlice } from '@reduxjs/toolkit';
+
+const { reducer, actions } = createSlice({
+ name: 'positions',
+ initialState: {
+ items: {},
+ },
+ reducers: {
+ update(state, action) {
+ action.payload.forEach(item => state.items[item['deviceId']] = item);
+ },
+ }
+});
+
+export { actions as positionsActions };
+export { reducer as positionsReducer };