react-use icon indicating copy to clipboard operation
react-use copied to clipboard

Add Generic Fn for useDebounce

Open Ruslan-web955 opened this issue 2 months ago • 0 comments

For useDebounce hook add type parameter for returned Function.

Example:

const useDebounce = <F extends (...args: any[]) => any>(
	func: F,
	wait: number = 0,
): F => {
	return useMemo<F>(() => debounce(func, wait), [func, wait]);
};

Ruslan-web955 avatar Oct 27 '25 21:10 Ruslan-web955