vanilla.bindText
bindText(element, getter): () => void
Directly synchronizes an HTML element's textContent with a reactive getter function.
| Name | Type | Description |
|---|---|---|
element |
HTMLElement |
The HTML element whose text content will be updated. |
getter |
() => string | number |
Pure function returning the reactive string or number to render. |
fn
A dispose function to unbind the reactive text synchronization.
(): void
void
Example