mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-23 01:38:11 +08:00
35 lines
610 B
JavaScript
35 lines
610 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;
|