The context (this value) to be used when calling the debounced function.
The function to debounce.
The duration (in milliseconds) to wait after the last invocation before calling the function. Defaults to 300 milliseconds.
A debounced version of the provided function.
Rest ...args: anyconst debouncedFn = debounce(this, myFunction, 500);
debouncedFn(arg1, arg2);
Debounces a function, ensuring it is called after a specified timeout has passed since the last invocation.