UIElement Docs Version 0.13.3

🔗 Function: on()

on<K, E>(type, listener, options): Effect<ComponentProps, E>

Defined in: src/lib/effects.ts:646

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

🔗 Type Parameters

🔗 K

K extends string

🔗 E

E extends HTMLElement

🔗 Parameters

🔗 type

K

Event type

🔗 listener

(event) => void

Event listener function

🔗 options

Event listener options

boolean | AddEventListenerOptions

🔗 Returns

Effect<ComponentProps, E>

Effect function that manages the event listener

🔗 Since

0.12.0