mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-27 03:58:11 +08:00
* do not create unecessary option state for categories we will not display * performance improvements for categorical metadata handling
35 lines
606 B
JavaScript
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;
|