hoxa
Version:
A comprehensive collection of 100+ production-ready React hooks for state management, UI effects, forms, animations, and more. Carefully curated and optimized for performance and developer experience.
15 lines (14 loc) • 373 B
TypeScript
type AsyncFunction<T> = () => Promise<T>;
type AsyncState<T> = {
loading: boolean;
error: Error | null;
value: T | null;
retryCount: number;
retry: () => void;
cancel: () => void;
};
export declare function useAsyncRetry<T>(asyncFunction: AsyncFunction<T>, options?: {
retryDelay?: number;
maxRetries?: number;
}): AsyncState<T>;
export {};