Returns a debounced version of fn that delays invocation until wait ms have elapsed since the last call.
fn
wait
The function to debounce.
Delay in milliseconds.
const handleInput = debounce((value: string) => search(value), 300)// search is called only after the user stops typing for 300ms Copy
const handleInput = debounce((value: string) => search(value), 300)// search is called only after the user stops typing for 300ms
Returns a debounced version of
fnthat delays invocation untilwaitms have elapsed since the last call.