Skip to main content

Call your app

Ask a registered host service to do work and display its result.

Before you start: Compose components.

Your app registers actions before creating a session. call account.save with … into result invokes one action and introduces a handler-local result. This preview bundles a deterministic mock that returns the supplied name.

Call one host action​

Press Save name: the status becomes Saved Sam. Expand Environment & events to inspect the mock call.

<Column state="{status:'Ready'}" class="p-4 gap-3">
<Button title="Save name" on-press="call account.save with {name:'Sam'} into result; set status to 'Saved ' + result.name" />
<Text bind-text="status" />
</Column>
Call one host action
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

Try it: Change the name in the payload and press again. The mock makes no network request.

Handle an action error​

A try / catch block converts a recoverable action error into visible status. The bundled mock succeeds for valid input.

<Column state="{status:'Ready'}" class="p-4 gap-3">
<Button title="Save name" on-press="try call account.save with {name:'Sam'} into result; set status to 'Saved ' + result.name catch failure set status to failure.message end" />
<Text bind-text="status" />
</Column>
Handle an action error
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

Try it: Change the payload name to a number to exercise its type validation and display an error.

Next: deliver a document. The actions guide covers cancellation and concurrent work.