function useCategorySelection
useCategorySelection(initial?: Iterable<string>): [
Set<string>,
(id: string) => void,
(ids: Set<string>) => void
]

Returns the ids picked, starting from initial, a function that turns one on or off, and one that replaces them all. The dump creation dialog, the dump editor and the playlist forms send [...selected] as categoryIds.

Parameters

optional
initial: Iterable<string>

Return Type

[
Set<string>,
(id: string) => void,
(ids: Set<string>) => void
]

Usage

import { useCategorySelection } from "src/hooks/category/useCategorySelection.ts";