AsyncCollectionT
import type { AsyncCollectionT } from '@dr.pogodin/react-global-state';
The AsyncCollectionT type describes a segment of the global state managed by an useAsyncCollection() hook — a map between string/number IDs and corresponding data, wrapped into auxiliary envelopes:
type AsyncCollectionT<
DataT = unknown,
IdT extends number | string = number | string,
> = { [id in IdT]?: AsyncDataEnvelopeT<DataT> };
Generic Parameters
DataT
— The type of collection items, defaults uknown.IdT
— number | string — The type of collection keys (IDs), defaults number | string.