mount, update, and flush
mount(el, tag, options?)
mount clears the host, creates <tag> inside it, and returns the new element:
JavaScript
const app = mount(document.getElementById("app"), "x-app");
Pass { dev: true } while developing to show component error messages in the page and enable diagnostics for class/style bindings and live store subscriptions:
JavaScript
mount(document.getElementById("app"), "x-app", { dev: true });
update(el)
update(el) requests a re-render. Calls are batched, so an event can update ordinary state and request a single DOM flush.
flush()
flush() processes pending updates synchronously:
JavaScript
update(el); flush();