A page's state lives in one of three places, and the template says which. The URL's query: a route's parameter a control binds, <input bind=q> (a checkbox, a radio with its value=, a select's options alike); typing writes q in the address, without a history step. The page: <state open = false>…</state>, scoped as a <let>, one for each row in a loop (by its id), kept across every update of the page; only the browser reads it. A form: its state a value of a Jai type (below).
An element's events write state: on:click=(open = !open), on:click=(price = p), on any element; on:click=Cart.add(sku = p.sku) calls an action. The element that triggers says when and how often: debounce=300, throttle=200, edge="leading", requests="latest" (the default for drawing: a newer one cancels the older), "first" (the default for actions: no double submits), "queue", "all".
A change of state draws, in the browser, what the browser can compute from it (the template's own code, compiled from it: no request), asks origin for the parts it reaches that only origin can draw, each alone, and only else the page whole. The page carries no script of the app's: the runtime is the same for every app.