The function to debounce
The number of milliseconds to delay
Optional
options:
{ The options object
Optional
leading?: boolean
Specify invoking on the leading edge of the timeout
Optional
max
The maximum time func is allowed to be delayed
before it's invoked
Optional
trailing?: boolean
Specify invoking on the trailing edge of the timeout
Returns the new debounced function
Generated using TypeDoc
Creates a debounced function that delays invoking
funcuntil afterwaitmilliseconds have elapsed since the last time the debounced function was invoked, or until the next browser frame is drawn. Provideoptionsto indicate whetherfuncshould be invoked on the leading and/or trailing edge of thewaittimeout. Thefuncis invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the lastfuncinvocation. Note: Ifleadingandtrailingoptions aretrue,funcis invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during thewaittimeout. Ifwaitis0andleadingisfalse,funcinvocation is deferred until the next tick, similar tosetTimeoutwith a timeout of0.