diff options
Diffstat (limited to 'app/client/live/reducer.js')
| -rw-r--r-- | app/client/live/reducer.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/client/live/reducer.js b/app/client/live/reducer.js new file mode 100644 index 0000000..9d41c6f --- /dev/null +++ b/app/client/live/reducer.js @@ -0,0 +1,35 @@ +import { combineReducers } from 'redux' + +const liveInitialState = { + loading: false, + error: null, + opt: {}, +} + +const liveReducer = (state = liveInitialState, action) => { + let results; + + switch(action.type) { + case 'LIVE_LOAD_OPT_FROM_SERVER': + return { + ...state, + loading: false, + error: null, + opt: action.opt, + } + + case 'LIVE_SET_OPT': + return { + ...state, + opt: { + ...state.opt, + [action.key]: action.value, + } + } + + default: + return state + } +} + +export default liveReducer |
