interface AddEventListenerOptions
extends EventListenerOptions
Options for configuring an event listener via addEventListener.
This interface extends EventListenerOptions and provides additional configuration
options to control event listener behavior.
Examples #
#
eventTarget.addEventListener('message', handler, {
once: true,
passive: true,
signal: controller.signal
});
Properties #
When set to true, the listener will automatically be removed after it has been invoked once.
When set to true, indicates that the listener will never call preventDefault().
This provides a performance optimization opportunity for event processing.
If a passive listener attempts to call preventDefault(), the call will be ignored
and a warning may be generated.
#signal: AbortSignal optional
An AbortSignal that can be used to remove the event listener when aborted.