Module / v1.0.0-beta.7

@typed/template/EventHandler

17 unique exports available through this public import path, including their members and aliases.

import * as EventHandler from "@typed/template/EventHandler";

Default action control

  • preventDefault

    function

    Modifies an EventHandler to call preventDefault() on the event.

Event handler creation

  • make

    function

    Creates a new EventHandler.

Event handler protocol

  • EventHandlerTypeId

    variable

    The global symbol used to identify EventHandler values across module copies.

  • isEventHandler

    function

    Checks if a value is an EventHandler.

Event handlers

  • EventHandler

    interface

    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

  • catchCause

    variable

    Recovers from errors in the EventHandler.

Handler failures

  • Error

    type-alias

    Extracts the typed error channel of an EventHandler.

Handler normalization

  • fromEffectOrEventHandler

    function

    Helper to ensure a value is an EventHandler.

    If the input is already an EventHandler, it is returned as is. If it is an Effect, it is wrapped in an EventHandler that ignores the event argument.

Handler requirements

  • Services

    type-alias

    Extracts the Effect service requirements of an EventHandler.

Handler service provision

  • provide

    variable

    Provides services to the EventHandler.

    This allows you to inject dependencies into the effect returned by the event handler.

Listener lifetime

  • once

    function

    Modifies an EventHandler to run only once.

Native event control

Native event types

  • EventOf

    type-alias

    Extracts the native event type accepted by an EventHandler.

Native listener policy

  • EventOptions

    type-alias

    Options for applying native event behavior before an Effect handler runs.

  • passive

    function

    Modifies an EventHandler to be passive (improves scrolling performance).

Propagation control