deno.com

interface AddEventListenerOptions

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 #

#once: boolean
optional

When set to true, the listener will automatically be removed after it has been invoked once.

#passive: boolean
optional

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.

An AbortSignal that can be used to remove the event listener when aborted.