UIElement Docs Version 0.14.0

🔗 Function: on()

on<K, P, E>(type, handler, options): Effect<P, E>

Defined in: src/core/events.ts:147

Effect for attaching an event listener to an element.
Provides proper cleanup when the effect is disposed.

🔗 Type Parameters

🔗 K

K extends string

🔗 P

P extends ComponentProps

🔗 E

E extends Element = HTMLElement

🔗 Parameters

🔗 type

K

Event type

🔗 handler

EventHandler<P, E, EventType<K>>

Event handler function

🔗 options

Event listener options

boolean | AddEventListenerOptions

🔗 Returns

Effect<P, E>

Effect function that manages the event listener

🔗 Since

0.14.0