AsyncCollectionReloaderT
import type { AsyncCollectionReloaderT } from '@dr.pogodin/react-global-state';
The AsyncCollectionReloaderT type is the signature of data re-loader function
in the result of useAsyncCollection() hook (see reload in
UseAsyncCollectionResT). It is defined as generic type
export type AsyncCollectionReloaderT<
DataT,
IdT extends number | string = number | string,
> = (loader?: AsyncCollectionLoaderT<DataT, IdT>) => void | Promise<void>;
Generic Parameters
Arguments
loader— AsyncCollectionLoaderT<DataT, IdT> | undefined — Optional. The loader function to use; when it is not provided the loader given to the corresponding useAsyncCollection() hook is used.
Result
If the reload happens synchronously it returns right away; otherwise it returns a promise which resolves once the reload is completed (or aborted, either failed).