mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 13:58:12 +08:00
type makeContinousDimensionName callsite
This commit is contained in:
@@ -1,7 +1,24 @@
|
|||||||
import { makeContinuousDimensionName } from "../util/nameCreators";
|
import { Action } from "redux";
|
||||||
|
import type { RootState } from ".";
|
||||||
|
import {
|
||||||
|
ContinuousNamespace,
|
||||||
|
makeContinuousDimensionName,
|
||||||
|
} from "../util/nameCreators";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
|
export interface ContinuousSelectionAction extends Action<string> {
|
||||||
const ContinuousSelection = (state = {}, action: any) => {
|
continuousNamespace: ContinuousNamespace;
|
||||||
|
selection: string;
|
||||||
|
range: [number, number];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ContinuousSelectionState {
|
||||||
|
[name: string]: [number, number];
|
||||||
|
}
|
||||||
|
|
||||||
|
const ContinuousSelection = (
|
||||||
|
state: ContinuousSelectionState = {},
|
||||||
|
action: ContinuousSelectionAction
|
||||||
|
): RootState => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case "reset subset":
|
case "reset subset":
|
||||||
case "subset to selection":
|
case "subset to selection":
|
||||||
@@ -25,7 +42,6 @@ const ContinuousSelection = (state = {}, action: any) => {
|
|||||||
action.continuousNamespace,
|
action.continuousNamespace,
|
||||||
action.selection
|
action.selection
|
||||||
);
|
);
|
||||||
// @ts-expect-error ts-migrate(2537) FIXME: Type '{}' has no matching index signature for type... Remove this comment to see the full error message
|
|
||||||
const { [name]: deletedField, ...newState } = state;
|
const { [name]: deletedField, ...newState } = state;
|
||||||
return newState;
|
return newState;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user