Events and concurrency
on-name handles a declared component event. event is its JSON payload.
Events do not bubble; wrappers forward explicitly with emit.
Quick reference
| Form | Behavior |
|---|---|
on-press | Drops duplicate invocations while this handler is running |
on-change.latest | Supersedes the previous invocation for this element/event |
on-press.busy="saving" | Runtime-owned busy boolean companion |
model="value" | Assigns event.value before explicit handler filtering |
Example
<Column state="{saving:false, status:'Ready'}">
<Button title="Save" on-press.busy="saving"
on-press="call account.save with {name:'Sam'}; set status to 'Saved'" />
<Progress show="saving" label="Saving" />
<Text bind-text="status" />
</Column>
Busy ownership
The busy path must name an existing local boolean initialized false. One handler
owns its writes. Do not also set, toggle, or model it. The runtime clears it after
success, failure, or cancellation. .latest can use the same base spelling for
its busy companion. Unknown modifiers, duplicate bodies for one event, and busy
metadata without a handler are errors.
Cancellation and lifetime
Cancellation skips catch. Finally may do synchronous local cleanup while its scope survives; it cannot call native services, emit, write host state, or await during cancellation cleanup. Destruction discards cleanup state writes. Stale continuations are rejected, but the runtime cannot undo a write already committed by a host service. Use host-level idempotency where needed.
Handler concurrency identity is logical element instance plus event. Events queue in FIFO order; model assignment precedes filtering. Programmatic prop updates do not synthesize user-change events.
Action lesson · call · emit