diff --git a/src/reducers/controls.js b/src/reducers/controls.js new file mode 100644 index 00000000..1d06bfb0 --- /dev/null +++ b/src/reducers/controls.js @@ -0,0 +1,14 @@ +const Controls = (state = { + color: null, +}, action) => { + switch (action.type) { + case "color changed": + return Object.assign({}, state, { + color: action.data, + }); + default: + return state; + } +}; + +export default Controls; diff --git a/src/reducers/index.js b/src/reducers/index.js index b844e299..62124b94 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -4,11 +4,13 @@ import thunk from "redux-thunk"; import initialize from "./initialize"; import cells from "./cells"; +import controls from "./controls"; import selectedMetadata from "./selectedMetadata"; const Reducer = combineReducers({ initialize, cells, + controls, selectedMetadata, })