Docs (4.0.0)
class ViewComposite 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). If the return value is true or a promise, the event is considered handled and no further action is taken. Otherwise, the event is emitted again on the ViewComposite instance itself.
  • This method may be overridden to handle events in any other way, e.g. to propagate them by emitting the same event on the ViewComposite instance itself.

Parameters

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

Return value

This method always returns true since the event is either handled or emitted again.

Related