The function to debounce.
The number of milliseconds to wait before calling the function.
Additional options for the function.
A debounced function.
Debouncing postpones the execution until after a period of inactivity. It's ideal for tasks that don't need to execute repeatedly in quick succession, such as API calls based on user input.
Note that this cannot be converted to an arrow function, because the context
of this
is important during the call. Arrow functions significantly change the
way the context is managed.
Returns a debounced function that delays execution until wait milliseconds have passed since its last invocation.