Action
Named store chains and code-shipped primitives that run when a Function slot fires.
An Action is a named, ordered chain of calls on a store. The same call shape also names a primitive (set-property, navigate, …) or a hook method (<hookId>.setFieldValue). You never put a sequence on an element — an event slot holds one call; multi-step lives on the store.
Bind a call on a Function slot with update_props (Props).

A call
| Name | Type | Default | Description |
|---|---|---|---|
functionId | string | — | Primitive slug, store action id, or "<hookId>.<method>". |
instanceParams | object | — | Call-site arguments. Keys match the target's param names. |
when | {{…}} | always | If falsy at dispatch, the call (and a store action's whole chain) is skipped. |
functionId is one of three things:
| Target | functionId | Where it lives |
|---|---|---|
| Primitive | slug, e.g. "set-property" | Built-in. Discover with list_primitive_functions. |
| Store action | the action's id | stores.<name>.actions[]. |
| Hook method | "<hookId>.<method>" | The hook row's id, not its alias. |
Unknown ids throw Unknown action id: … at dispatch.
Primitives
Client primitives run in the browser. Server primitives with public access run from the published app by reloading the owner's saved binding — see Function.
list_primitive_functions returns the live param catalog per id.
Write one store field. value may be a literal or a {{…}} expression.
| Param | Type | Description |
|---|---|---|
store | string | Store name. |
property | string | Field to write. |
value | literal or {{…}} | New value. |
{{event}} is the first argument the host passed — for onValueChange / onOpenChange / onCheckedChange that argument is the new value. Native onChange is usually {{event.target.value}}.
Declare every field you write, with a defaultValue. An undeclared field resolves to undefined and flips controlled inputs. A computed field (editable: false + an expression defaultValue) is derived on read; do not target it with set-property.
Other primitives
functionId | Context | Params | Notes |
|---|---|---|---|
delay | client | milliseconds | Wait before the next link in a store action. |
browser-alert | client | message | Blocking alert(). |
log | client | label, value | Console log for wiring. |
toast | client | title, description?, type?, timeout?, id?, anchor? | Repeating id replaces; anchor is an element binding. |
code-action | client | code, async? | JS expression; its value becomes {{event}} for onSuccess. Reach browser APIs as {{js.navigator.clipboard.writeText(…)}}. |
abort-controller-create | client | store, property | Writes a live AbortController onto the field. After .abort() it is spent — call again. |
http-request | server, public | url, method?, headers?, body?, responseStore?, responseProperty? | Secrets as {{env.X}} resolve on the server. Result { status, data } — 2xx is success, 4xx/5xx fires onError with the same shape. |
supabase-login | server, public | email, password | Writes {{session.*}} (pending / user / error). Do not declare a session store. |
supabase-signup | server, public | email, password | Same session seam. |
supabase-logout | server, public | (none) | Clears the session cookie. |
supabase-query | server, public | table, operation?, values?, match?, filters?, columns?, single?, maybeSingle?, order?, limit?, rangeFrom?, rangeTo?, count?, onConflict?, returning?, guestToken?, plus optional response capture | Runs as the signed-in user (or anon) under RLS, only against this app's project. |
Server primitives optionally capture { ok, status, data } into responseStore / responseProperty after a successful settle.
Store actions
A store holds actions. One action is a reusable chain; its functions array is the only place a sequence lives.
| Name | Type | Description |
|---|---|---|
id | string | Bind this as functionId — not the name. |
name | string | Human name. Also the expression {{stores.<store>.<name>(…)}}. |
functions | call list | Ordered links. Each link is a call (functionId + instanceParams). |
params | field list | Optional signature. Call-site instanceParams resolve first; inner links read {{params.<name>}}. |
returns | type | Optional return type. |
Inside the chain, {{this.<field>}} is the owning store's live state.
The chain awaits each link. Its value is the last link's settled value. A later link may read what an earlier one wrote ({{event}}, a responseStore capture).
A synchronous value the host reads at the call site (filter, itemToStringLabel, validate) must be a single code-action whose body is not declared async: true. That callable is also reachable as {{stores.<name>.<actionName>(…)}}. Anything richer (a primitive, a multi-link chain, a body marked async) settles to a Promise.
update_store wholesale-replaces fields and actions. list_stores first (pass storeId for the full arrays), append in memory, send the whole array.
onSuccess / onError
Any primitive binding may carry reserved continuation slots in instanceParams. They are not primitive params: they are stripped before dispatch and never sent to the server.
Exactly one fires after settle:
| Slot | When |
|---|---|
onError | The primitive threw, or it returned a soft failure ({ ok: false }). |
onSuccess | Otherwise. |
Each value is a nested call (client, server, or store action). The outcome is {{event}} for the handler. Auth primitives re-read {{session.*}} after they write it, so a login's onSuccess sees the new user.
Example: supabase-login with email / password from the login store, and onSuccess → navigate to home.
Unhandled soft failure stops a store-action chain — wire onError to continue. A handler that itself fails is that handler's failure, not the original primitive's.
Expressions on a call
instanceParams values may be literals or {{…}}. A whole-binding string ("{{event}}") is stored as an expression. Nested objects and arrays resolve too. Mixed text ("Hello {{stores.user.name}}") stays a string and interpolates.
On dispatch, these namespaces are in scope:
| Expression | Meaning |
|---|---|
{{event}} | Handler argument, or the previous link / continuation's value. |
{{stores.<name>.<field>}} | Live store state. |
{{hooks.<alias>.<key>}} | Hook output (values, data, matches, …). |
{{this.<field>}} | Owning store, inside a store action. |
{{params.<name>}} | Declared action inputs, inside a store action. |
{{session.*}} / {{page.*}} | Ambient viewer / route. Display only — authorization is the session cookie + RLS. |
{{env.X}} | Server-only secrets; stay literal on the client so the server resolves them. |
{{js.*}} | Browser globals (clipboard, localStorage, …), event-time on the client only. |
{{props.*}} | Enclosing component instance props, including host callbacks. |