Documentation / @ripl/vue / useForwardedEvents
Function: useForwardedEvents() ​
useForwardedEvents<
TEventMap>(source,emit):void
Defined in: adapters/vue/src/core/events.ts:70
Forwards an event bus's events to Vue listeners, subscribing only to those a listener is actually bound to.
The eligible names come from the bus itself (EventBus.$events), so the adapter cannot drift from the events a Ripl object actually emits.
The filtering is not an optimisation. Element.on invalidates the context's tracked-element cache for pointer events, so subscribing to everything up front would silently make every element a hit-test target and change which element receives a click.
Type Parameters ​
| Type Parameter |
|---|
TEventMap extends EventMap |
Parameters ​
| Parameter | Type | Description |
|---|---|---|
source | () => EventBus<TEventMap> | undefined | The bus to forward from, e.g. an element, context or renderer. |
emit | (event, ...args) => void | The component's emit function. |
Returns ​
void