@mirawision/reactive-hooks
Version:
A comprehensive collection of 50+ React hooks for state management, UI interactions, device APIs, async operations, drag & drop, audio/speech, and more. Full TypeScript support with SSR safety.
17 lines (16 loc) • 796 B
TypeScript
/**
* A hook that returns a debounced value that only updates after a specified delay has passed
* since the last time the value changed.
* @param value The value to debounce
* @param delay The delay in milliseconds. If <= 0, returns the value directly
* @returns The debounced value
*/
export declare function useDebounce<T>(value: T, delay: number): T;
/**
* A hook that returns a debounced version of the provided function that only executes
* after a specified delay has passed since its last invocation.
* @param fn The function to debounce
* @param delay The delay in milliseconds. If <= 0, returns the function directly
* @returns The debounced function with stable identity
*/
export declare function useDebounceFn<F extends (...args: any[]) => any>(fn: F, delay: number): F;