API reference · generated from source
Function: createRetreeConvexAction()#
function createRetreeConvexAction<Action>(client, action): RetreeConvexAction<Action>;Defined in: retree-convex/src/actions.ts:38
Create a typed Retree Convex action function from a Convex client and action reference.
Type Parameters#
| Type Parameter |
|---|
Action extends ActionReference |
Parameters#
| Parameter | Type | Description |
|---|---|---|
client | IConvexActionClient | Convex client used to run the action. |
action | Action | Convex action function reference. |
Returns#
RetreeConvexAction<Action>
A typed action function.
Remarks#
Use this when you need a typed action helper outside a BaseConvexNode. Actions are imperative calls and do not emit Retree changes by themselves. Assign the action result into Retree state if the UI should update from it.
Example#
const generateSummary = createRetreeConvexAction(
client,
api.ai.generateSummary
);
const summary = await generateSummary({ taskId });
state.summary = summary; // ✅ emits if `state` is Retree-managed