From e05904f2e992ce3184952a8e569d9c28d85d68de Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 21 May 2018 02:49:46 +0200 Subject: basic css for form elements --- app/client/live/reducer.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 app/client/live/reducer.js (limited to 'app/client/live/reducer.js') 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 -- cgit v1.2.3-70-g09d2