Batch Actions
useActions: execute multiple actions in parallel
Execute All at Once
Calls createTodo, listTodos, and searchTodos simultaneously using Promise.allSettled.
How it works
import { createTodo, listTodos, searchTodos } from '#actions'
const { execute, pending, results, hasErrors } = useActions([
createTodo,
listTodos,
searchTodos,
])
// Execute all with corresponding inputs
await execute([
{ title: 'New batch todo' }, // createTodo input
{}, // listTodos input (none)
{ q: 'Learn' }, // searchTodos input
])