useTaskQueue
Run async tasks in order with a limit on how many run at once. Use it for uploads, batch requests and any work that should not flood the network.
- Level
- Advanced
- Since
- v2.1.0
import {useTaskQueue} from '@zenuilabs/react-hooks';Loading demo_
More in Async & Data
Async & DataIntermediateuseAsyncRun an async function and track its loading, error and data. Only the most recent call updates state, so a slow earlier call never overwrites a newer result.Async & DataIntermediateuseAsyncRetryRun an async function and retry it when it fails, with a fixed delay or backoff. Use it for flaky network calls that usually succeed on a second try.Async & DataAdvanceduseCachedFetchStale-while-revalidate data fetching with a cache shared by every component. Cached data renders instantly while a background request refreshes it.