vanilla.bindDOM
bindDOM<T>(element, updater): () => void
Binds a DOM element to reactive signals using a custom updater callback.
| Name | Type | Description |
|---|---|---|
T |
extends Element |
The type of DOM Element. |
| Name | Type | Description |
|---|---|---|
element |
T |
The native DOM element to update. |
updater |
(el: T) => void |
Callback receiving the element and executing mutations based on reactive state. |
fn
A dispose function to unbind the reactive effect.
(): void
void
Remarks
Runs synchronously on registration to apply initial DOM attributes/styles, then automatically
re-executes whenever reactive signals or proxy properties read within updater change.
Example