Holds the categories picked in a form's CategorySelect.

Functions

f
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.

Usage

import * as mod from "src/hooks/category/useCategorySelection.ts";