UNPKG

beautiful-react-hooks

Version:

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

15 lines (14 loc) 675 B
/// <reference types="lodash" /> import { GenericFunction } from './shared/types'; export declare type DebounceOptions = { leading?: boolean | undefined; maxWait?: number | undefined; trailing?: boolean | undefined; }; /** * Accepts a function and returns a new debounced yet memoized version of that same function that delays * its invoking by the defined time. * If time is not defined, its default value will be 250ms. */ declare const useDebouncedCallback: <TCallback extends GenericFunction>(fn: TCallback, dependencies?: any[], wait?: number, options?: DebounceOptions) => import("lodash").DebouncedFunc<TCallback>; export default useDebouncedCallback;