diff options
author | ditoaugusta <dt_ap@ymail.com> | 2020-03-25 00:26:02 +0700 |
---|---|---|
committer | ditoaugusta <dt_ap@ymail.com> | 2020-03-25 00:26:02 +0700 |
commit | 4d200181a6a97c8143d0843f07d90072ef35e25c (patch) | |
tree | 06a4f732dc09511e5c1b80f9b030f4e60285477c /modern/src/reducers/index.js | |
parent | 506fe663e2e3b9ffe9764f5c06b04524c4793534 (diff) | |
download | etbsa-traccar-web-4d200181a6a97c8143d0843f07d90072ef35e25c.tar.gz etbsa-traccar-web-4d200181a6a97c8143d0843f07d90072ef35e25c.tar.bz2 etbsa-traccar-web-4d200181a6a97c8143d0843f07d90072ef35e25c.zip |
delete actions and reducers folder
Diffstat (limited to 'modern/src/reducers/index.js')
-rw-r--r-- | modern/src/reducers/index.js | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/modern/src/reducers/index.js b/modern/src/reducers/index.js deleted file mode 100644 index 752a4c3..0000000 --- a/modern/src/reducers/index.js +++ /dev/null @@ -1,35 +0,0 @@ -const initialState = { - devices: new Map(), - positions: new Map() -}; - -function updateMap(map, array, key) { - for (let value of array) { - map.set(value[key], value); - } - return map; -} - -function rootReducer(state = initialState, action) { - switch (action.type) { - case 'UPDATE_DEVICES': - return Object.assign({}, { - ...state, - devices: updateMap(state.devices, action.devices, 'id') - }); - case 'UPDATE_POSITIONS': - return Object.assign({}, { - ...state, - positions: updateMap(state.positions, action.positions, 'deviceId') - }); - case 'SELECT_DEVICE': - return Object.assign({}, { - ...state, - selectedDevice: action.device.id - }); - default: - return state; - } -} - -export default rootReducer |