UNPKG

beautiful-react-hooks

Version:

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

14 lines (13 loc) 648 B
/// <reference types="lodash" /> import { GenericFunction } from './shared/types'; interface ThrottleSettings { leading?: boolean | undefined; trailing?: boolean | undefined; } /** * Accepts a function and returns a new throttled yet memoized version of that same function that waits the defined time * before allowing the next execution. * If time is not defined, its default value will be 250ms. */ declare const useThrottledCallback: <TCallback extends GenericFunction>(fn: TCallback, dependencies?: any[], wait?: number, options?: ThrottleSettings) => import("lodash").DebouncedFunc<TCallback>; export default useThrottledCallback;