diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-07 16:09:01 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-07 16:09:01 +1200 |
commit | 72aa50650203d6db0b17de59bfd98c9d5b06e3e7 (patch) | |
tree | 0cdd9aced5356f8e32d23069cd0bec2b5c8ef484 /modern/src/reducers/index.js | |
parent | 06c4ee387669b1ccb5aa3928fbaa7c3650bfb7fa (diff) | |
download | trackermap-web-72aa50650203d6db0b17de59bfd98c9d5b06e3e7.tar.gz trackermap-web-72aa50650203d6db0b17de59bfd98c9d5b06e3e7.tar.bz2 trackermap-web-72aa50650203d6db0b17de59bfd98c9d5b06e3e7.zip |
Add redux and load positions
Diffstat (limited to 'modern/src/reducers/index.js')
-rw-r--r-- | modern/src/reducers/index.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modern/src/reducers/index.js b/modern/src/reducers/index.js new file mode 100644 index 00000000..b9c94771 --- /dev/null +++ b/modern/src/reducers/index.js @@ -0,0 +1,18 @@ +const initialState = { + devices: [], + positions: [], + events: [] +}; + +function rootReducer(state = initialState, action) { + switch (action.type) { + case 'UPDATE_POSITIONS': + return Object.assign({}, { + positions: [...state.positions, ...action.positions] + }); + default: + return state; + } +} + +export default rootReducer |