Cookbook / Controller

Controller

display

controller() intrinsic — a ResizeObserver reactive controller with hostConnected/hostDisconnected lifecycle, writes routed through an action.

id
aihu-controller
since
0.5.0
file
aihu-controller.aihu
stateactioncontrollercontroller.describeinterpolation

Run it

source · static

This recipe doesn't have a hydrated island in the demo gallery yet. An in-browser, WASM-compiled playground (edit this source and re-render live) is planned as a follow-up — read the real source below.

Source

aihu-controller.aihu

Requires

concerns
stateevents

Anti-patterns

  • Do not write state directly inside a controller body (C561) — controllers are derivations; route writes through an action.

Related recipes