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.
13 lines (12 loc) • 343 B
TypeScript
export declare function useRetry<T>(asyncFn: () => Promise<T>, options: {
retries: number;
retryDelay?: number;
onSuccess?: (data: T) => void;
onError?: (error: Error, attempt: number) => void;
}): {
data: T | null;
error: Error | null;
loading: boolean;
attempt: () => Promise<void>;
retry: () => void;
};