Default action control
preventDefaultfunction
Modifies an
EventHandlerto callpreventDefault()on the event.
Event handler creation
makefunction
Creates a new
EventHandler.
Event handler protocol
EventHandlerTypeIdvariable
The global symbol used to identify
EventHandlervalues across module copies.isEventHandlerfunction
Checks if a value is an
EventHandler.
Event handlers
EventHandlerinterface
Represents a DOM event handler that returns an Effect.
It encapsulates the event handler logic and any options (like
preventDefault,once, etc.) that should be applied when the event is triggered.
Handler failure recovery
catchCausevariable
Recovers from errors in the
EventHandler.
Handler failures
Errortype-alias
Extracts the typed error channel of an
EventHandler.
Handler normalization
fromEffectOrEventHandlerfunction
Helper to ensure a value is an
EventHandler.If the input is already an
EventHandler, it is returned as is. If it is anEffect, it is wrapped in anEventHandlerthat ignores the event argument.
Handler requirements
Servicestype-alias
Extracts the Effect service requirements of an
EventHandler.
Handler service provision
providevariable
Provides services to the
EventHandler.This allows you to inject dependencies into the effect returned by the event handler.
Listener lifetime
oncefunction
Modifies an
EventHandlerto run only once.
Native event control
handleEventOptionsfunction
Applies event options to a native DOM event.
Native event types
EventOftype-alias
Extracts the native event type accepted by an
EventHandler.
Native listener policy
EventOptionstype-alias
Options for applying native event behavior before an Effect handler runs.
passivefunction
Modifies an
EventHandlerto be passive (improves scrolling performance).
Propagation control
stopImmediatePropagationfunction
Modifies an
EventHandlerto callstopImmediatePropagation()on the event.stopPropagationfunction
Modifies an
EventHandlerto callstopPropagation()on the event.