type makeContinousDimensionName callsite

This commit is contained in:
Seve Badajoz
2021-08-12 16:35:27 -07:00
parent 8850c78af9
commit 70c65897c8
+20 -4
View File
@@ -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.
const ContinuousSelection = (state = {}, action: any) => {
export interface ContinuousSelectionAction extends Action<string> {
continuousNamespace: ContinuousNamespace;
selection: string;
range: [number, number];
}
export interface ContinuousSelectionState {
[name: string]: [number, number];
}
const ContinuousSelection = (
state: ContinuousSelectionState = {},
action: ContinuousSelectionAction
): RootState => {
switch (action.type) {
case "reset subset":
case "subset to selection":
@@ -25,7 +42,6 @@ const ContinuousSelection = (state = {}, action: any) => {
action.continuousNamespace,
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;
return newState;
}