Debounce
Debounces a function so it won't be executed until after a given delay has passed since the most recent time it was called.
Debounces a function so it won't be executed until after a given delay has passed since the most recent time it was called.
debounce(fn, delay)
Creates a new version of the function fn
, which will only be executed once delay
milliseconds has passed since the most recent time it was called.
A function to be debounced.
The number of milliseconds that must pass since the most recent time the function is called before it will be executed.
This button will only be activated after 200 ms has passed since its last activation:
This button will only be activated after a second has passed since its last activation: