use-lodash-debounce-throttle
Version:
Bring debounce & throttle of lodash version to react-hooks
17 lines (16 loc) • 631 B
TypeScript
interface DebounceSettings {
/**
* Specify invoking on the leading edge of the timeout.
*/
leading?: boolean;
/**
* The maximum time func is allowed to be delayed before it’s invoked.
*/
maxWait?: number;
/**
* Specify invoking on the trailing edge of the timeout.
*/
trailing?: boolean;
}
declare const useDebounce: (fn: import("./createCancelableHook").Fn, wait?: number | undefined, options?: DebounceSettings | undefined, deps?: readonly any[] | undefined) => import("./createCancelableHook").Fn & import("./createCancelableHook").Cancelable;
export default useDebounce;