Bindable Objects are the base class for most components including views, and models.

Two-way data binding means linking properties of two separate objects - when one changes, the other will automatically update with that change. It enables much easier interactions between data models and UIs, among other uses outside of MVC.


npm install bindable --save-exact


creates a new bindable object

value get(property)

Returns a property on the bindable object

set(property, value)

Sets a value to the bindable object


sets multiple properties on the bindable object


Returns true if the bindable object has a given property

listener on(event, callback)

adds a new listener to the bindable object


emits a new event

once(event, callback)

listens to one event, then disposes the listener.


returns all the listeners on the bindable object

binding bind(from, options)

options - the options for the binding

  • to - the property to bind to. Can be a string, array, or function
  • target - the target bindable object. Default is self
  • max - max number of times to run the data-binding
  • when - tests the data-bound value before setting
  • map - transforms the data-bound value
  • bothWays - makes the data-binding bi-directional.

Executes a binding now


Disposes a binding


Bindable objects emit a few events:

  • change:* - emitted when a property changes on the bindable object. E.g:
  • change - emitted when any property changes on the bindable object
  • watching - emitted when a property is being watched
  • dispose - emitted when dispose() is called on a bindable object