use-lodash-debounce-throttle
Version:
Bring debounce & throttle of lodash version to react-hooks
13 lines (12 loc) • 550 B
TypeScript
interface ThrottleSettings {
/**
* If you'd like to disable the leading-edge call, pass this as false.
*/
leading?: boolean;
/**
* If you'd like to disable the execution on the trailing-edge, pass false.
*/
trailing?: boolean;
}
declare const useDebounce: (fn: import("./createCancelableHook").Fn, wait?: number | undefined, options?: ThrottleSettings | undefined, deps?: readonly any[] | undefined) => import("./createCancelableHook").Fn & import("./createCancelableHook").Cancelable;
export default useDebounce;