handleEvent
A method that’s called when an event is emitted on the observed object, may be overridden.
protected
protected handleEvent(event: ManagedEvent): void
Notes
- Override this method to add a non-specific event handler. This method will be called for all events.
- The base implementation calls both synchronous and asynchronous named event handlers.
- Synchronous event handlers such as
onFoo()oronSomeEvent()are called immediately; the event is supplied as the only argument. - Asynchronous event handlers such as
onFooAsync()oronSomeEventAsync()are called asynchronously (afterPromise.resolve()), with a single argument which is the latest event that occurred before the function was called. If multiple events with the same name have been emitted, theon...Asyncmethod is called only once.
Related
- class ObserverThe base class for an observer that watches a particular ManagedObject.
- handleUnlink() protectedA method that’s called when the observed object is unlinked, may be overridden.
- handleAttachedChange(origin) protectedA method that’s called when the observed object has been attached to another object, may be overridden.
