debounce

Debounces/throttles an event by waiting for at maximum firing a request once in a wait timeout period. Fires an even only after a timeout has expired and then only the last one since the last one was fired. Effectively this throttles the event frequency to once in the timeout period.

Useful for reducing the amount of events fired for very chatty interfaces. For example, window resizing or auto-complete key acceptance.

debounce(func,wait,immediate)

Parameters

func
The function that is to be debounced.

wait
The wait interval at which time the debounced function is called.

immediate
if true, func passed is immediately called


© West Wind Technologies, 1996-2022 • Updated: 06/07/20
Comment or report problem with topic