mount()
Attach a WhisqNode to a DOM element.
Signature
Section titled “Signature”function mount(node: WhisqNode, container: Element): () => voidParameters
Section titled “Parameters”| Param | Type | Description |
|---|---|---|
node | WhisqNode | The node to mount |
container | Element | Target DOM element |
Returns
Section titled “Returns”() => void — dispose function that unmounts and cleans up all effects.
Examples
Section titled “Examples”import { div, mount } from "@whisq/core";
const dispose = mount( div("Hello Whisq"), document.getElementById("app")!,);
// Later: unmountdispose();