function / @typed/template

EventHandler.handleEventOptions

Applies event options to a native DOM event.

Package version
1.0.0-beta.7
Category
Native event control
Since
1.0.0
Member of
EventHandler

Import

import { EventHandler } from "@typed/template";

Access EventHandler.handleEventOptions through the imported EventHandler export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare function handleEventOptions<Ev extends Event>(eventOptions: EventOptions, ev: Ev): boolean;

Why

Centralizing these calls guarantees that options invoke the supplied event’s methods before its Effect handler runs. For rendered handlers those methods are bound through the EventSource Proxy to the underlying native event.

Ownership and lifetime

The function borrows the event for the call and retains nothing.

Examples

import { handleEventOptions } from "@typed/template/EventHandler"

handleEventOptions({ preventDefault: true }, new Event("submit", { cancelable: true }))

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source