mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-05 08:48:12 +08:00
renaming backend, cellxgene to server, client respectively
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
// jshint esversion: 6
|
||||
const Cells = (
|
||||
state = {
|
||||
cells: null /* world */,
|
||||
loading: null,
|
||||
error: null,
|
||||
|
||||
allCells: null /* this comes from cells endpoint, this is universe */
|
||||
},
|
||||
action
|
||||
) => {
|
||||
switch (action.type) {
|
||||
case "request cells started":
|
||||
return Object.assign({}, state, {
|
||||
loading: true,
|
||||
error: null
|
||||
});
|
||||
case "request cells success":
|
||||
return Object.assign({}, state, {
|
||||
error: null,
|
||||
loading: false,
|
||||
cells: action.data, // most recently loaded cells
|
||||
|
||||
/* Universe - initialize once */
|
||||
allCells: state.allCells ? state.allCells : action.data
|
||||
});
|
||||
case "request cells error":
|
||||
return Object.assign({}, state, {
|
||||
loading: false,
|
||||
error: action.data
|
||||
});
|
||||
case "reset graph":
|
||||
return Object.assign({}, state, {
|
||||
cells: state.allCells
|
||||
});
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default Cells;
|
||||
Reference in New Issue
Block a user