Creates a debounced function that delays invoking func until after wait
milliseconds have elapsed since the last time the debounced function was invoked.
The debounced function comes with a cancel method to cancel delayed func invocations.
If wait is provided as a non-number value the function will be invoked
immediately.
When the debounced function is called it returns a promise that resolves with
the result of the invoked func or a rejected promise if calling the
function throws an error.
Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a cancel method to cancel delayed func invocations.
If wait is provided as a non-number value the function will be invoked immediately.
When the debounced function is called it returns a promise that resolves with the result of the invoked
func
or a rejected promise if calling the function throws an error.