UNPKG

@lesnoypudge/utils-react

Version:

lesnoypudge's utils-react

19 lines (18 loc) 631 B
import { T } from '@lesnoypudge/types-utils-base/namespace'; export declare namespace useDebounce { type Options = { /** * Disable state updating. * Ref will keep updating. */ stateless?: boolean; }; } /** * Provides a debounced function with the option to track debouncing state. */ export declare const useDebounce: (options?: useDebounce.Options) => { isDebouncing: boolean; isDebouncingRef: import('react').MutableRefObject<boolean>; debounce: <_Callback extends T.AnyFunction>(callback: _Callback, delay: number) => (...args: Parameters<_Callback>) => void; };