diff --git a/src/actions/tree.ts b/src/actions/tree.ts index f9708bf40..34967f0e4 100644 --- a/src/actions/tree.ts +++ b/src/actions/tree.ts @@ -16,8 +16,10 @@ import { Metadata } from "../metadata"; import { AppDispatch, RootState } from "../store"; import { ReduxNode, TreeState } from "../reducers/tree/types"; +type RootIndex = number | undefined + /** [root idx tree1, root idx tree2] */ -export type Root = [number | undefined, number | undefined] +export type Root = [RootIndex, RootIndex] /** A function to be handled by redux (thunk) */ type ThunkFunction = (dispatch: AppDispatch, getState: () => RootState) => void @@ -31,7 +33,7 @@ type ThunkFunction = (dispatch: AppDispatch, getState: () => RootState) => void */ export const applyInViewNodesToTree = ( /** index of displayed root node */ - idx: number | undefined, + idx: RootIndex, tree: TreeState, ): number => {