Docs (4.0.0)
class Activity method

delegateViewEvent

Delegates events from the current view.

protected

protected delegateViewEvent(event: ManagedEvent): boolean | Promise<unknown>

Notes

  • This method is called automatically when an event is emitted by the current view object.
  • The base implementation calls activity methods starting with on, e.g. onClick for a Click event. The event is passed as a single argument, and the return value should either be true, undefined, or a promise (which is awaited just to be able to handle any errors).
  • This method may be overridden to handle events in any other way, e.g. to propagate them by emitting the same event on the activity object itself.

Parameters

  • event — The event to be delegated (from the view)

Return value

True if an event handler was found, and it returned true; false otherwise.

Related

  • class ActivityA class that represents a part of the application that can be activated when the user navigates to it.