Interface BindableInterface<PropName>

The interface that must be implemented by the left and right side objects of a Binding. Methods of this interface enable the synchronization of watches by making properties reactive: when a property changes, watchers of that property (that is, the binding) will be notified.

Type Parameters

  • PropName extends PropertyName = string

Hierarchy

  • BindableInterface

Methods

Methods

  • Returns the value of the property propName. This function will be called, for example, when the Binding is notified about an update (via watch).

    Parameters

    • propName: PropName

      the name of the property

    Returns any

    the current value of the property

  • Sets the property propName to value. This function is called by Bindings to propagate property changes from one object to the other.

    When a property called propName on the "source" Bindable of a binding changes, the "target" Bindable will eventually receive the updated value via this function.

    Parameters

    • propName: PropName

      the name of the property

    • value: any

      the new value of the property

    Returns void

  • Registers a watch callback for the property propName on this Bindable.

    This function will be called by a Binding when it is configured to synchronize changes of this property to another object. The callback must be invoked by this Bindable when the property is updated in order to notify the Binding about the change.

    Parameters

    • propName: PropName

      the name of the property

    • callback: WatchCallback

      a callback function that takes no arguments

    Returns WatchHandle

    an object implementing WatchHandle that allows the Binding to unregister the watch.

Generated using TypeDoc