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. The func is invoked with the last arguments provided to the debounced function.
If wait is 0, func invocation is deferred until to the next tick, similar to setTimeout with a timeout of 0.
Differences from lodash:
the debounced function does not come with a flush method
does not accept options
does not return the results of the last invocation
does not make any guarantees about the value of this in func
Contribution to minified bundle size, when it is the only function imported:
Creates a debounced function that delays invoking
func
until afterwait
milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with acancel
method to cancel delayedfunc
invocations. Thefunc
is invoked with the last arguments provided to the debounced function.If
wait
is 0,func
invocation is deferred until to the next tick, similar tosetTimeout
with a timeout of0
.Differences from lodash:
flush
methodthis
infunc
Contribution to minified bundle size, when it is the only function imported: