Files
cellxgene/client/src/reducers/config.js
T
Bruce Martin 0c271bc815 categorical metadata performance work (#356)
* do not create unecessary option state for categories we will not display

* performance improvements for categorical metadata handling
2018-10-22 09:56:41 -07:00

35 lines
606 B
JavaScript

// jshint esversion: 6
const Config = (
state = {
displayNames: null,
features: null,
parameters: null
},
action
) => {
switch (action.type) {
case "initial data load start":
return {
...state,
loading: true,
error: null
};
case "configuration load complete":
return {
...state,
loading: false,
error: null,
...action.config
};
case "initial data load error":
return {
...state,
error: action.error
};
default:
return state;
}
};
export default Config;