Documentation

type ViewBuilderEventHandler

A type of event handler that can be added by a view builder.

type ViewBuilderEventHandler<TView extends View = View, TData = {}> = (
event: ObservableEvent<View, Record<string, unknown> & TData>,
view: TView,
) => boolean | void | Promise<void>;

Note
The view that the handler listens to (passed as a second argument) may not be the event source, since an event may have originated from within the view hierarchy.

Note
The handler can return true or call event.stopPropagation() to stop the event from propagating to parent objects.