UNPKG

@rbxts/pretty-react-hooks

Version:
10 lines (9 loc) 432 B
/// <reference types="@rbxts/compiler-types" /> /** * Runs an async effect and cancels the promise when unmounting the effect. * Note that effects paused by `await` still run while cancelled, so prefer * to use promise chaining instead. * @param effect The async effect to run. * @param deps The dependencies to run the effect on. */ export declare function useAsyncEffect(effect: () => Promise<any>, deps?: unknown[]): void;