Files
cellxgene/client/src/reducers/differential.js
T
Bruce Martin 2d5bc9d0c9 Performance work, plus fix #405 (#406)
* 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
2018-11-05 13:57:58 -08:00

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;