Shares the site's categories, of both kinds, with every component.
CategoriesProvider fills this context and useCategories reads one kind's
from it.
I
CategoriesContextValue
Provided by CategoriesProvider to useCategories, for the category
switchers and pickers, the dump and playlist pages and cards, and the
category manager.
-
categories: Category[]
Every category, dump and playlist ones, in the server's order, by kind, position then slug.
-
isLoaded: boolean
Whether the first fetch has ended. It is also true after a network error, with no categories.
-
refresh: () => Promise<void>
Refetches the list. The category manager calls it after each change.
v
CategoriesContext: React.Context<CategoriesContextValue>
The categories' context. Its default, an empty list never loaded, is only
seen outside CategoriesProvider.
Usage
import * as mod from "src/contexts/category/CategoriesContext.ts";