Docs (4.0.0)
class Observer method

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() or onSomeEvent() are called immediately; the event is supplied as the only argument.
  • Asynchronous event handlers such as onFooAsync() or onSomeEventAsync() are called asynchronously (after Promise.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, the on...Async method is called only once.

Related