debounce
Code location
debounce<
T
,V
>(cb
,timeout
?,resetTimer
?):Debouncer
<T
,V
>
A standard debounce function. Use this to have a time-delayed function only be called once in a given timeframe.
Type Parameters
• T extends unknown
[]
• V
Parameters
• cb
The function to call.
• timeout?: number
The timeout to wait, in milliseconds
• resetTimer?: boolean
Whether to reset the timeout when the debouncer is called again.
Returns
Debouncer
<T
, V
>
a debounced function that takes the same parameter as the original function.