Binding
classin packageklyn.binding
public class Binding
Binding

Common one-way, two-way and watch data-binding engine.

The API is shared by window and terminal widgets. It binds observable state declared with signal property; the compiler emits the change notification automatically when the property setter completes. UI events use event declarations and payload classes from klyn.events or klyn.gui.events. User code observes or binds state; it never fires a signal property manually.

Binding.twoWay(slider::value, spin::value)
Binding.watch(slider::value, lambda(value as Object): print(value))
Methods
Modifier and Type Member Description
public static oneWay
oneWay(left as BindingRef, right as BindingRef) as Void
Synchronizes right from left and keeps it updated.
public static twoWay
twoWay(left as BindingRef, right as BindingRef) as Void
Synchronizes both members and keeps them mutually updated.
public static unwatch
unwatch(source as BindingRef, handler as Object) as Void
Unregisters a previously registered callback.
public static watch
watch(source as BindingRef, handler as Object) as Void
Registers a callback invoked when the referenced signal property changes.