Class: Debouncer

qui.utils.Debouncer(func, delayopt, maxWaitopt, nullable)

A class that debounces function calls, ensuring that a function is not called more often than a specified delay.

Constructor

new Debouncer(func, delayopt, maxWaitopt, nullable)

Parameters:
Name Type Attributes Default Description
func function

the function to debounce

delay Number <optional>
0

the debouncing delay, in milliseconds (defaults to 0)

maxWait Number <optional>
<nullable>
null

the longest the call may be postponed, in milliseconds, however many times it is made; null (the default) postpones it indefinitely

Source:

Methods

call()

Call function ensuring debouncing condition. Any previous pending call is cancelled. Arguments are passed to the function when called.

Source:

isPending() → {Boolean}

Tell if there is a pending call.

Source:
Returns:
Type
Boolean