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) 499 B
import { GenericFunction } from './shared/types'; export declare type UseIntervalOptions = { cancelOnUnmount?: boolean; }; /** * An async-utility hook that accepts a callback function and a delay time (in milliseconds), then repeats the * execution of the given function by the defined milliseconds. */ declare const useInterval: <TCallback extends GenericFunction>(fn: TCallback, milliseconds: number, options?: UseIntervalOptions) => (boolean | (() => void))[]; export default useInterval;