observable<T>(obj?): T & (abstract new (...args: any[]) => ObservableMixin)
Mixin to add observable functionality to a class.
Observability allows you to watch for changes to properties on an object.
Observability is handled by this mixin but if you have an accessor property
that is backed by a backing field and that backing field is updated
separately from the accessor set, you must call
support/observableUtils!notifyChange for the accessor property after
the backing field has changed to ensure watchers are notified of the change.
The implementation of the mixin expects that accessor properties with a
setter use the value given to the setter as the new value that will be
returned by the getter.
Mixin to add observable functionality to a class.
Observability allows you to watch for changes to properties on an object.
Observability is handled by this mixin but if you have an accessor property that is backed by a backing field and that backing field is updated separately from the accessor set, you must call support/observableUtils!notifyChange for the accessor property after the backing field has changed to ensure watchers are notified of the change.
The implementation of the mixin expects that accessor properties with a setter use the value given to the setter as the new value that will be returned by the getter.
See support/observableUtils!watch.
See support/observableUtils!notifyChange.
See support/observableUtils!onWatch.
See support/observableUtils!watchEvent.
See support/observableUtils!once.
Usage example of the mixin by wrapping a base class.
Usage example of the mixin used as a base class.
Usage example of the mixin by wrapping a class implementation.
Note: while this pattern is supported, it is not recommended since it will not allow observable functionality to be used by the class in itself.