use-async-effect
Version:
Asynchronous side effects, without the nonsense
15 lines (12 loc) • 371 B
Flow
declare module 'use-async-effect' {
declare function useAsyncEffect(
effect: (isMounted: () => boolean) => any | Promise<any>,
inputs?: any[]
): void;
declare function useAsyncEffect<V>(
effect: (isMounted: () => boolean) => V | Promise<V>,
destroy?: ?(result?: V) => void,
inputs?: any[]
): void;
declare export default useAsyncEffect;
}