UNPKG

beautiful-react-hooks

Version:

A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development

11 lines (10 loc) 486 B
import { GenericFunction } from './shared/types'; export declare type UseTimeoutOptions = { cancelOnUnmount?: boolean; }; /** * An async-utility hook that accepts a callback function and a delay time (in milliseconds), then delays the * execution of the given function by the defined time. */ declare const useTimeout: <TCallback extends GenericFunction>(fn: TCallback, milliseconds: number, options?: UseTimeoutOptions) => (boolean | (() => void))[]; export default useTimeout;