use-async-effekt-hooks
Version:
React hooks for async effects and memoization with proper dependency tracking and linting support
10 lines • 515 B
TypeScript
import { DependencyList } from "react";
/**
* A hook for memoizing async computations with dependency tracking.
*
* @param factory - An async function that returns the memoized value
* @param deps - Dependency array for the memoization
* @returns The memoized value, undefined while loading, or the last successful value on error
*/
export declare function useAsyncMemo<T>(factory: (isMounted: () => boolean) => Promise<T> | T, deps?: DependencyList): T | undefined;
//# sourceMappingURL=useAsyncMemo.d.ts.map