Spaces:
Running
Running
File size: 702 Bytes
f2bee8a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
const UPDATE_TOOLBOX = 'scratch-gui/toolbox/UPDATE_TOOLBOX';
import makeToolboxXML from '../lib/make-toolbox-xml';
const initialState = {
toolboxXML: makeToolboxXML(true)
};
const reducer = function (state, action) {
if (typeof state === 'undefined') state = initialState;
switch (action.type) {
case UPDATE_TOOLBOX:
return Object.assign({}, state, {
toolboxXML: action.toolboxXML
});
default:
return state;
}
};
const updateToolbox = function (toolboxXML) {
return {
type: UPDATE_TOOLBOX,
toolboxXML: toolboxXML
};
};
export {
reducer as default,
initialState as toolboxInitialState,
updateToolbox
};
|