aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/modules/positions.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/store/modules/positions.js')
-rw-r--r--modern/src/store/modules/positions.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modern/src/store/modules/positions.js b/modern/src/store/modules/positions.js
new file mode 100644
index 00000000..1df468cd
--- /dev/null
+++ b/modern/src/store/modules/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 };