Overview
taskAction manages a concurrent task queue. You add items, control concurrency, and track per-task status, progress, and results — all reactively. Ideal for file uploads, imports, offline sync replay, or any workflow where multiple async jobs should be orchestrated together.
Each task receives an AbortSignal as its second argument so cancellation via stop() (or per-task abort) can cleanly unwind in-flight work. Derived getters like runningTasks() and successTasks() let you drive progress UI without manual bookkeeping.
vs asyncAction
|
Capability
|
asyncAction
|
taskAction
|
|---|---|---|
| Unit of work | Single invocation | Queue of many items with per-task lifecycle. |
| Concurrency | One in-flight (latest wins / cancel) | Configurable concurrency (serial by default, or N at once). |
| Progress | isLoading / status |
progress() 0–100 + filtered task lists by status.
|
| Cancellation |
cancel() drops result
|
stop() / per-task AbortSignal for real abort.
|
taskAction — queue, concurrency, pause, delete
clearAndStart with concurrency 2. addAndStart appends while running. pause() lets in-flight tasks finish; start() resumes; stop() aborts via the task signal; delete() removes one task.