UseCommandEventsPropsType
import { UseCommandEventsPropsType } from "@hyper-fetch/react"
Description
Defined in helpers/use-command-events/use-command-events.types.ts:21
Preview
type UseCommandEventsPropsType<T> = {
actions: UseTrackedStateActions<T>;
command: T;
dispatcher: Dispatcher;
logger: LoggerType;
setCacheData: (cacheData: CacheValueType<ExtractResponse<T>, ExtractError<T>>) => void;
}
Structure
{
actions: {
setData: (data: ExtractResponse<T>, emitToCache?: boolean) => void;
setError: (error: ExtractError<T>, emitToCache?: boolean) => void;
setLoading: (loading: boolean, emitToHooks?: boolean) => void;
setRetries: (retries: number, emitToCache?: boolean) => void;
setStatus: (status: number | null, emitToCache?: boolean) => void;
setTimestamp: (timestamp: Date, emitToCache?: boolean) => void;
};
command: T;
dispatcher: Dispatcher;
logger: Record<LoggerLevelType, (message: LoggerMessageType, ...additionalData: LoggerMessageType[]) => void>;
setCacheData: (cacheData: CacheValueType<ExtractResponse<T>, ExtractError<T>>) => void;
}