diff options
| author | jules@lens <julescarbon@gmail.com> | 2018-05-21 03:02:35 +0200 |
|---|---|---|
| committer | jules@lens <julescarbon@gmail.com> | 2018-05-21 03:02:35 +0200 |
| commit | 6bd402bc11a0350479e4d88dc995ab9eb5a75117 (patch) | |
| tree | e3e44a12d357c201d129cbbcb639bf2224a8aaa1 /app/client/live/reducer.js | |
| parent | 03566b61318fef6f3ba64334bee7e75f6b7f7c59 (diff) | |
| parent | e05904f2e992ce3184952a8e569d9c28d85d68de (diff) | |
blash
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 |
