From 72aa50650203d6db0b17de59bfd98c9d5b06e3e7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 7 Sep 2018 16:09:01 +1200 Subject: Add redux and load positions --- modern/src/reducers/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 modern/src/reducers/index.js (limited to 'modern/src/reducers/index.js') diff --git a/modern/src/reducers/index.js b/modern/src/reducers/index.js new file mode 100644 index 0000000..b9c9477 --- /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 -- cgit v1.2.3