@sgnl-pro/react-tree
Version:
A tree view component for React
12 lines (9 loc) • 344 B
text/typescript
import { SelectionType } from '../types';
export const noop = function () {};
export const isSelectableItem = (
selectionType: SelectionType,
isParent: boolean
) =>
selectionType === SelectionType.All ||
(selectionType === SelectionType.Parent && isParent === true) ||
(selectionType === SelectionType.Child && isParent === false);