API Reference
useConvexAction
Reference for the shared action composable.
useConvexAction wraps a generated Convex action and exposes the same pending and error pattern as useConvexMutation.
Import
Nuxt
const { execute } = useConvexAction(api.tasks.processAndSave)
Vue
import { useConvexAction } from 'vue-convex'
Signature
function useConvexAction<Action extends FunctionReference<'action'>>(
action: Action,
): {
execute: (args: FunctionArgs<Action>) => Promise<FunctionReturnType<Action>>
error: Ref<Error | null>
isPending: ComputedRef<boolean>
}
Return value
| Field | Type | Meaning |
|---|---|---|
execute | (args) => Promise<T> | Executes the action |
error | Ref<Error | null> | Latest action error |
isPending | ComputedRef<boolean> | true while one or more calls are in flight |
Behavior
- Requires a connected realtime client
- Intended for non-transactional work, side effects, or orchestration
- Does not accept optimistic updates