mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-27 22:18:11 +08:00
* remove memoization * update to flash 1.0.2; turn on threading * stand-alone helper routines for array slicing * fix issue #405 * reset diffexp state when world changes * performance work in dimension creation; fix world slicing bug * update tests to match new state mgmt api * update flask * do not make dimensions for useless annotations * update test to match optimizations
64 lines
1.3 KiB
JavaScript
64 lines
1.3 KiB
JavaScript
// jshint esversion: 6
|
|
|
|
const Differential = (
|
|
state = {
|
|
diffExp: null,
|
|
loading: null,
|
|
error: null,
|
|
celllist1: null,
|
|
celllist2: null
|
|
},
|
|
action
|
|
) => {
|
|
switch (action.type) {
|
|
case "request differential expression started":
|
|
return {
|
|
...state,
|
|
loading: true,
|
|
error: null
|
|
};
|
|
case "request differential expression success":
|
|
return {
|
|
...state,
|
|
error: null,
|
|
loading: false,
|
|
diffExp: action.data
|
|
};
|
|
case "request differential expression error":
|
|
return {
|
|
...state,
|
|
loading: false,
|
|
error: action.data
|
|
};
|
|
case "store current cell selection as differential set 1":
|
|
return {
|
|
...state,
|
|
celllist1: action.data
|
|
};
|
|
case "store current cell selection as differential set 2":
|
|
return {
|
|
...state,
|
|
celllist2: action.data
|
|
};
|
|
case "clear differential expression":
|
|
return {
|
|
...state,
|
|
diffExp: null,
|
|
celllist1: null,
|
|
celllist2: null
|
|
};
|
|
case "reset World to eq Universe":
|
|
case "set World to current selection":
|
|
return {
|
|
...state,
|
|
diffExp: null,
|
|
celllist1: null,
|
|
celllist2: null
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default Differential;
|