Spaces:
Running
Running
File size: 596 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 |
const UPDATE_MONITORS = 'scratch-gui/monitors/UPDATE_MONITORS';
import {OrderedMap} from 'immutable';
const initialState = OrderedMap();
const reducer = function (state, action) {
if (typeof state === 'undefined') state = initialState;
switch (action.type) {
case UPDATE_MONITORS:
return action.monitors;
default:
return state;
}
};
const updateMonitors = function (monitors) {
return {
type: UPDATE_MONITORS,
monitors: monitors
};
};
export {
reducer as default,
initialState as monitorsInitialState,
updateMonitors
};
|