action
Custom application action. Used by the built-in menuButton, custom toolbar items, and custom context-menu entries to surface app-level events. Has no built-in store handler - the dispatch is forwarded to the onAction prop and to any handler registered via api.on("action", ...).
Usage
type ActionPayload = { id: string; [key: string]: any };
| Field | Type | Description |
|---|---|---|
id | string | Identifier of the custom action (e.g. "menu-button", "export-pdf"). |
[key: string] | any | Optional extra payload fields forwarded as-is to handlers. |
action is not part of the typed StoreActions map. Calls to api.exec("action", ...) are routed to onAction and on("action", ...) listeners only.
Trigger
api.exec("action", { id: "export-pdf" });
Observe
api.on("action", p => console.log("action:", p.id));
Intercept
api.intercept("action", p => p.id !== "blocked");
Component handler
<Calendar onAction={p => console.log("action:", p.id)} />
Related articles
toolbar— items that dispatchaction(e.g.menuButton).exec— programmatically fire a custom action.on— register a handler for"action".- Navigation bar — wiring custom toolbar buttons.
- Context menu — forwarding custom menu ids as actions.