UNPKG

@ohm-vision/react-async

Version:

Extentions to React to support asynchronous calls

10 lines (9 loc) 465 B
import { DependencyList, EffectCallback } from "react"; /** * Basic wrapper to support an asynchronous call * @param effect asynchronous effect * @param deps Dependency List * @param destructor Destructor * @returns `true` if the effect is still running, or `false` once the effect completes */ export declare function useEffectAsync(effect: (signal: AbortController) => Promise<void>, deps: DependencyList, destructor?: ReturnType<EffectCallback>): boolean;