Classes
Observable
Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener.
Please note that should you be using the
`new Observable({})`
constructor, it is **obsolete** since v3.0,
and you have to migrate to the "data/observable" `fromObject({})`
or the `fromObjectRecursive({})`
functions.Summary
Constructors
Properties
Constructors
constructor
new Observable(): Observable
Returns Observable
Properties
propertyChangeEvent
Static
String value used when hooking to propertyChange event.
Methods
_createPropertyChangeData
_createPropertyChangeData(propertyName: string, value: any, oldValue?: any): PropertyChangeData
This method is intended to be overriden by inheritors to provide additional implementation.
Returns PropertyChangeData
_emit
addEventListener
addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void
Adds a listener for the specified event name.
Returns void
get
Gets the value of the specified property.
Returns any
hasListeners
Checks whether a listener is registered for the specified event name.
Returns boolean
notify
Notify this Observable instance with some data. This causes all event
handlers on the Observable instance to be called, as well as any 'global'
event handlers set on the instance's class.
Returns void
notifyPropertyChange
Notifies all the registered listeners for the property change event.
Returns void
off
off(eventNames: string, callback?: (data: EventData) => void, thisArg?: any): void
Shortcut alias to the removeEventListener method.
Returns void
on
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void
A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
Returns void
once
once(event: string, callback: (data: EventData) => void, thisArg?: any): void
Adds one-time listener function for the event named
`event`
. Returns void
removeEventListener
removeEventListener(eventNames: string, callback?: (data: EventData) => void, thisArg?: any): void
Removes listener(s) for the specified event name.
Returns void
set
Updates the specified property with the provided value.
Returns void
setProperty
Updates the specified property with the provided value and raises a property change event and a specific change event based on the property name.
Returns void
addEventListener
Static
addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: any): void
- Previous
- NavigationButton
- Next
- ObservableArray