From 506fe663e2e3b9ffe9764f5c06b04524c4793534 Mon Sep 17 00:00:00 2001 From: ditoaugusta Date: Wed, 25 Mar 2020 00:24:33 +0700 Subject: delete module subfolder. edit relative path. --- modern/src/store/positions.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modern/src/store/positions.js (limited to 'modern/src/store/positions.js') 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 }; -- cgit v1.2.3