TanStack Pacer is a library of utilities for controlling when functions run: debouncing, throttling, rate limiting, queuing, and batching. Plenty of libraries ship a debounce helper. We built Pacer because we kept needing the details those one-liners skip: full type safety, tree-shaking, cancellation, pending state you can render, and one consistent API across all five patterns and every framework adapter. Execution timing is usually an afterthought until a race condition or a hammered API forces the issue. Pacer's job is to make the correct pattern the easy one to reach for.
Important
TanStack Pacer is currently in beta and its API is still subject to change.
The scope of this library may grow, but we hope to keep the bundle size of each individual utility lean and focused.
Many of the ideas (and code) for TanStack Pacer are not new. In fact, many of these utilities have been living in other TanStack libraries for quite some time. We extracted code from TanStack Query, Router, Form, and even Tanner's original Swimmer library. Then we cleaned up these utilities, filled in some gaps, and shipped them as a standalone library.
Note
TanStack Pacer is mostly a client-side library today, but we are designing the core so it can work on the server as well.
The fastest way to understand the five utilities is to watch them handle the same input. Move the range slider and compare how debouncing, throttling, rate limiting, queuing, and batching each respond:
Pacer Lite (@tanstack/pacer-lite) is a stripped-down version of the core library, meant for npm packages that want minimal overhead. Each Lite utility behaves the same as its full counterpart but drops reactivity, framework adapters, devtools support, and some advanced options in exchange for a smaller bundle. If you are building an application, use the regular packages. Reach for Lite when you are publishing a library and every kilobyte counts.