mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-27 15:48:13 +08:00
30 lines
574 B
JavaScript
30 lines
574 B
JavaScript
const Initialize = (state = {
|
|
data: null,
|
|
loading: null,
|
|
error: null,
|
|
}, action) => {
|
|
switch (action.type) {
|
|
case "initialize started":
|
|
return Object.assign({}, state, {
|
|
loading: true,
|
|
error: null
|
|
});
|
|
case "initialize success":
|
|
return Object.assign({}, state, {
|
|
error: null,
|
|
loading: false,
|
|
data: action.data,
|
|
});
|
|
case "initialize error":
|
|
return Object.assign({}, state, {
|
|
data: null,
|
|
loading: false,
|
|
error: action.data
|
|
});
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default Initialize;
|