DebounceBinding

utils/binding. DebounceBinding

Class used to create two-way bindings which debounces the transmission of backend values to a widget option. If the widget supports the generic 'interacting' option, it can be used to block incoming values while the user is interacting with the widget. Alternatively, incoming values are delayed until a certain time after the last value modification was generated by a user.

Constructor

new DebounceBinding(widget, name, time, use_interactingopt)

Source:
Parameters:
Name Type Attributes Default Description
widget Object

The Widget.

name String

The option name.

time Number

Number of milliseconds to delay values passed to set after the last 'useraction' event for the option name.

use_interacting Boolean <optional>
true

If true, use the interacting option of the widget to delay incoming values while a user is interacting with the widget.

Methods

destroy()

Source:

Remove all event subscriptions. If the last value received by the backend has been delayed, it will not be passed to the widget.

isLocked()

Source:

Returns true if values are currently being debounced.

set()

Source:

Receive a value from the backend. Unless the value is delayed by timer or by the user interaction, this method calls `this.widget.set(this.name, value)'.