Loading...
Loading...
TanStack Pacer for rate limiting, throttling, debouncing, and async queuing. Use when controlling execution frequency, managing API rate limits, debouncing user input, or queuing async tasks. Use for pacer, throttle, debounce, rate-limit, queue, async-throttle, rate-limiting.
npx skill4agent add oakoss/agent-skills tanstack-pacersetTimeout| Pattern | API | Key Points |
|---|---|---|
| Debounce function | | Waits for inactivity; no |
| Throttle function | | Even spacing; |
| Rate limit | | Fixed or sliding window; rejects calls over limit |
| Queue items | | FIFO default; supports LIFO, priority, expiration |
| Async queue | | Concurrency control, retry, error callbacks |
| Async batch | | Collects items, processes as batch after wait/maxSize |
| React debounce | | Instance hook vs simple callback hook |
| React throttle | | Instance hook vs simple callback hook |
| React rate limit | | Instance hook vs simple callback hook |
| React queue | | Instance hook vs state-integrated hook |
| React async queue | | Concurrency + state management |
| React batch | | Sync and async batching hooks |
| State hooks | | Integrate with React state directly |
| Value hooks | | Create derived debounced/throttled values |
| Mistake | Correct Pattern |
|---|---|
Using | Debouncer has no |
| Creating instances inside render | Create with hooks ( |
Ignoring | Rate limiter and throttler may reject calls; check state or use callbacks |
| Using debounce when throttle is needed | Debounce waits for pause; throttle guarantees max-once-per-interval |
| Not cleaning up on unmount | React hooks handle cleanup automatically; manual instances need |
| Using Queuer when items can be dropped | Queuers process every item; use throttle/debounce if dropping is acceptable |
| Fixed window when sliding is needed | Fixed windows allow bursts at boundaries; sliding window gives smoother rate |
Forgetting | Rejected calls are silent by default; add |
Not passing | All utilities support |
If theskill is available, delegate data fetching and cache management tasks to it. TanStack Pacer complements Query for controlling request frequency. Otherwise, recommend:tanstack-querynpx skills add oakoss/agent-skills --skill tanstack-query
tanstack-query