# llms-full (private-aware)
> Built from GitHub files and website pages. Large files may be truncated.

--- docs/installation.md ---
---
title: Installation
id: installation
---

You can install TanStack Pacer with any [NPM](https://npmjs.com) package manager.

Only install one of the following packages depending on your use case:

## React

```sh
npm install @tanstack/react-pacer
```

TanStack Pacer is compatible with React v16.8+

## Solid

```sh
npm install @tanstack/solid-pacer
```

TanStack Pacer is compatible with Solid v1.9.5+

## Vanilla JS

```sh
npm install @tanstack/pacer
```

Install the the core `@tanstack/pacer` package to use with any framework or without a framework. Each framework package up above will also re-export everything from this core package.

> [!IMPORTANT] 
> There's no need to install the `@tanstack/pacer` core package if you've already installed one of the above framework packages.

## Devtools (Optional)

To use the devtools for debugging and monitoring, install both the framework devtools and the Pacer devtools packages:

### React Devtools

```sh
npm install @tanstack/react-devtools @tanstack/react-pacer-devtools
```

### Solid Devtools

```sh
npm install @tanstack/solid-devtools @tanstack/solid-pacer-devtools
```

See the [devtools](https://pacer.tanstack.com/docs/devtools) documentation for more information on how to set up and use the Pacer devtools.

## Links discovered
- [NPM](https://npmjs.com)
- [devtools](https://pacer.tanstack.com/docs/devtools)

--- docs/overview.md ---
---
title: Overview
id: overview
---

TanStack Pacer is a library focused on providing high-quality utilities for controlling function execution timing in your applications. While similar utilities exist elsewhere, we aim to get all the important details right - including ***type-safety***, ***tree-shaking***, and a consistent and ***intuitive API***. By focusing on these fundamentals and making them available in a ***framework agnostic*** way, we hope to make these utilities and patterns more commonplace in your applications. Proper execution control is often an afterthought in application development, leading to performance issues, race conditions, and poor user experiences that could have been prevented. TanStack Pacer helps you implement these critical patterns correctly from the start!

> [!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.

## Origin

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](https://github.com/tannerlinsley/swimmer) library. Then we cleaned up these utilities, filled in some gaps, and shipped them as a standalone library.

## Features

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

## Interactive Comparison Demo

Each utility is designed to be used in a specific way, and each utility has its own unique behavior.

See how each utility behaves with this interactive comparison. Move the range slider to observe the differences between debouncing, throttling, rate limiting, queuing, and batching:

<iframe src="https://stackblitz.com/github/TanStack/pacer/tree/main/examples/react/util-comparison?embed=1&view=preview&hideNavigation=1" width="100%" height="1200px" style="border: 1px solid #ccc; border-radius: 4px;"></iframe>

## Pacer Lite

Pacer Lite (`@tanstack/pacer-lite`) is a stripped down version of the core TanStack Pacer library. It is designed to be used in libraries and npm packages that need minimal overhead, and no reactivity features. The Lite version of each utility has the same core functionality of its core counterpart, but is stripped down to have a slightly smaller API surface and a smaller bundle size. Pacer Lite lacks reactivity features, framework adapters, devtools support, and some of the advanced options that the core utilities have. If that sounds interesting to you, you can 

## Links discovered
- [Swimmer](https://github.com/tannerlinsley/swimmer)

--- docs/reference/index.md ---
---
id: "@tanstack/pacer"
title: "@tanstack/pacer"
---

# @tanstack/pacer

## Classes

- [AsyncBatcher](classes/AsyncBatcher.md)
- [AsyncDebouncer](classes/AsyncDebouncer.md)
- [AsyncQueuer](classes/AsyncQueuer.md)
- [AsyncRateLimiter](classes/AsyncRateLimiter.md)
- [AsyncRetryer](classes/AsyncRetryer.md)
- [AsyncThrottler](classes/AsyncThrottler.md)
- [Batcher](classes/Batcher.md)
- [Debouncer](classes/Debouncer.md)
- [Queuer](classes/Queuer.md)
- [RateLimiter](classes/RateLimiter.md)
- [Throttler](classes/Throttler.md)

## Interfaces

- [AsyncBatcherOptions](interfaces/AsyncBatcherOptions.md)
- [AsyncBatcherState](interfaces/AsyncBatcherState.md)
- [AsyncDebouncerOptions](interfaces/AsyncDebouncerOptions.md)
- [AsyncDebouncerState](interfaces/AsyncDebouncerState.md)
- [AsyncQueuerOptions](interfaces/AsyncQueuerOptions.md)
- [AsyncQueuerState](interfaces/AsyncQueuerState.md)
- [AsyncRateLimiterOptions](interfaces/AsyncRateLimiterOptions.md)
- [AsyncRateLimiterState](interfaces/AsyncRateLimiterState.md)
- [AsyncRetryerOptions](interfaces/AsyncRetryerOptions.md)
- [AsyncRetryerState](interfaces/AsyncRetryerState.md)
- [AsyncThrottlerOptions](interfaces/AsyncThrottlerOptions.md)
- [AsyncThrottlerState](interfaces/AsyncThrottlerState.md)
- [BatcherOptions](interfaces/BatcherOptions.md)
- [BatcherState](interfaces/BatcherState.md)
- [DebouncerOptions](interfaces/DebouncerOptions.md)
- [DebouncerState](interfaces/DebouncerState.md)
- [PacerEventMap](interfaces/PacerEventMap.md)
- [QueuerOptions](interfaces/QueuerOptions.md)
- [QueuerState](interfaces/QueuerState.md)
- [RateLimiterOptions](interfaces/RateLimiterOptions.md)
- [RateLimiterState](interfaces/RateLimiterState.md)
- [ThrottlerOptions](interfaces/ThrottlerOptions.md)
- [ThrottlerState](interfaces/ThrottlerState.md)

## Type Aliases

- [AnyAsyncFunction](type-aliases/AnyAsyncFunction.md)
- [AnyFunction](type-aliases/AnyFunction.md)
- [OptionalKeys](type-aliases/OptionalKeys.md)
- [PacerEventName](type-aliases/PacerEventName.md)
- [QueuePosition](type-aliases/QueuePosition.md)

## Variables

- [pacerEventClient](variables/pacerEventClient.md)

## Functions

- [asyncBatch](functions/asyncBatch.md)
- [asyncBatcherOptions](functions/asyncBatcherOptions.md)
- [asyncDebounce](functions/asyncDebounce.md)
- [asyncDebouncerOptions](functions/asyncDebouncerOptions.md)
- [asyncQueue](functions/asyncQueue.md)
- [asyncQueuerOptions](functions/asyncQueuerOptions.md)
- [asyncRateLimit](functions/asyncRateLimit.md)
- [asyncRateLimiterOptions](functions/asyncRateLimiterOptions.md)
- [asyncRetry](functions/asyncRetry.md)
- [asyncRetryerOptions](functions/asyncRetryerOptions.md)
- [asyncThrottle](functions/asyncThrottle.md)
- [asyncThrottlerOptions](functions/asyncThrottlerOptions.md)
- [batch](functions/batch.md)
- [debounce](functions/debounce.md)
- [debouncerOptions](functions/debouncerOptions.md)
- [isFunction](functions/isFunction.md)
- [parseFunctionOrValue](functions/parseFunctionOrValue.md)
- [queue](functions/queue.md)
- [queuerOptions](functions/queuerOptions.md)
- [rateLimit](functions/rateLimit.md)
- [rateLimiterOptions](functions/rateLimiterOptions.md)
- [throttle](functions/throttle.md)
- [throttlerOptions](functions/throttlerOptions.md)


## Links discovered
- [AsyncBatcher](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/AsyncBatcher.md)
- [AsyncDebouncer](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/AsyncDebouncer.md)
- [AsyncQueuer](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/AsyncQueuer.md)
- [AsyncRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/AsyncRateLimiter.md)
- [AsyncRetryer](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/AsyncRetryer.md)
- [AsyncThrottler](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/AsyncThrottler.md)
- [Batcher](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/Batcher.md)
- [Debouncer](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/Debouncer.md)
- [Queuer](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/Queuer.md)
- [RateLimiter](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/RateLimiter.md)
- [Throttler](https://github.com/tanstack/pacer/blob/main/docs/reference/classes/Throttler.md)
- [AsyncBatcherOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncBatcherOptions.md)
- [AsyncBatcherState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncBatcherState.md)
- [AsyncDebouncerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncDebouncerOptions.md)
- [AsyncDebouncerState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncDebouncerState.md)
- [AsyncQueuerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncQueuerOptions.md)
- [AsyncQueuerState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncQueuerState.md)
- [AsyncRateLimiterOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncRateLimiterOptions.md)
- [AsyncRateLimiterState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncRateLimiterState.md)
- [AsyncRetryerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncRetryerOptions.md)
- [AsyncRetryerState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncRetryerState.md)
- [AsyncThrottlerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncThrottlerOptions.md)
- [AsyncThrottlerState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/AsyncThrottlerState.md)
- [BatcherOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/BatcherOptions.md)
- [BatcherState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/BatcherState.md)
- [DebouncerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/DebouncerOptions.md)
- [DebouncerState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/DebouncerState.md)
- [PacerEventMap](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/PacerEventMap.md)
- [QueuerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/QueuerOptions.md)
- [QueuerState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/QueuerState.md)
- [RateLimiterOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/RateLimiterOptions.md)
- [RateLimiterState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/RateLimiterState.md)
- [ThrottlerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/ThrottlerOptions.md)
- [ThrottlerState](https://github.com/tanstack/pacer/blob/main/docs/reference/interfaces/ThrottlerState.md)
- [AnyAsyncFunction](https://github.com/tanstack/pacer/blob/main/docs/reference/type-aliases/AnyAsyncFunction.md)
- [AnyFunction](https://github.com/tanstack/pacer/blob/main/docs/reference/type-aliases/AnyFunction.md)
- [OptionalKeys](https://github.com/tanstack/pacer/blob/main/docs/reference/type-aliases/OptionalKeys.md)
- [PacerEventName](https://github.com/tanstack/pacer/blob/main/docs/reference/type-aliases/PacerEventName.md)
- [QueuePosition](https://github.com/tanstack/pacer/blob/main/docs/reference/type-aliases/QueuePosition.md)
- [pacerEventClient](https://github.com/tanstack/pacer/blob/main/docs/reference/variables/pacerEventClient.md)
- [asyncBatch](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncBatch.md)
- [asyncBatcherOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncBatcherOptions.md)
- [asyncDebounce](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncDebounce.md)
- [asyncDebouncerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncDebouncerOptions.md)
- [asyncQueue](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncQueue.md)
- [asyncQueuerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncQueuerOptions.md)
- [asyncRateLimit](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncRateLimit.md)
- [asyncRateLimiterOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncRateLimiterOptions.md)
- [asyncRetry](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncRetry.md)
- [asyncRetryerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncRetryerOptions.md)
- [asyncThrottle](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncThrottle.md)
- [asyncThrottlerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/asyncThrottlerOptions.md)
- [batch](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/batch.md)
- [debounce](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/debounce.md)
- [debouncerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/debouncerOptions.md)
- [isFunction](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/isFunction.md)
- [parseFunctionOrValue](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/parseFunctionOrValue.md)
- [queue](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/queue.md)
- [queuerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/queuerOptions.md)
- [rateLimit](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/rateLimit.md)
- [rateLimiterOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/rateLimiterOptions.md)
- [throttle](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/throttle.md)
- [throttlerOptions](https://github.com/tanstack/pacer/blob/main/docs/reference/functions/throttlerOptions.md)

--- docs/framework/preact/reference/index.md ---
---
id: "@tanstack/preact-pacer"
title: "@tanstack/preact-pacer"
---

# @tanstack/preact-pacer

## Interfaces

- [PacerProviderOptions](interfaces/PacerProviderOptions.md)
- [PacerProviderProps](interfaces/PacerProviderProps.md)
- [PreactBatcher](interfaces/PreactBatcher.md)
- [PreactDebouncer](interfaces/PreactDebouncer.md)
- [PreactQueuer](interfaces/PreactQueuer.md)
- [PreactRateLimiter](interfaces/PreactRateLimiter.md)
- [PreactThrottler](interfaces/PreactThrottler.md)
- [ReactAsyncBatcher](interfaces/ReactAsyncBatcher.md)
- [ReactAsyncDebouncer](interfaces/ReactAsyncDebouncer.md)
- [ReactAsyncQueuer](interfaces/ReactAsyncQueuer.md)
- [ReactAsyncRateLimiter](interfaces/ReactAsyncRateLimiter.md)
- [ReactAsyncThrottler](interfaces/ReactAsyncThrottler.md)

## Functions

- [PacerProvider](functions/PacerProvider.md)
- [useAsyncBatchedCallback](functions/useAsyncBatchedCallback.md)
- [useAsyncBatcher](functions/useAsyncBatcher.md)
- [useAsyncDebouncedCallback](functions/useAsyncDebouncedCallback.md)
- [useAsyncDebouncer](functions/useAsyncDebouncer.md)
- [useAsyncQueuedState](functions/useAsyncQueuedState.md)
- [useAsyncQueuer](functions/useAsyncQueuer.md)
- [useAsyncRateLimitedCallback](functions/useAsyncRateLimitedCallback.md)
- [useAsyncRateLimiter](functions/useAsyncRateLimiter.md)
- [useAsyncThrottledCallback](functions/useAsyncThrottledCallback.md)
- [useAsyncThrottler](functions/useAsyncThrottler.md)
- [useBatchedCallback](functions/useBatchedCallback.md)
- [useBatcher](functions/useBatcher.md)
- [useDebouncedCallback](functions/useDebouncedCallback.md)
- [useDebouncedState](functions/useDebouncedState.md)
- [useDebouncedValue](functions/useDebouncedValue.md)
- [useDebouncer](functions/useDebouncer.md)
- [useDefaultPacerOptions](functions/useDefaultPacerOptions.md)
- [usePacerContext](functions/usePacerContext.md)
- [useQueuedState](functions/useQueuedState.md)
- [useQueuedValue](functions/useQueuedValue.md)
- [useQueuer](functions/useQueuer.md)
- [useRateLimitedCallback](functions/useRateLimitedCallback.md)
- [useRateLimitedState](functions/useRateLimitedState.md)
- [useRateLimitedValue](functions/useRateLimitedValue.md)
- [useRateLimiter](functions/useRateLimiter.md)
- [useThrottledCallback](functions/useThrottledCallback.md)
- [useThrottledState](functions/useThrottledState.md)
- [useThrottledValue](functions/useThrottledValue.md)
- [useThrottler](functions/useThrottler.md)


## Links discovered
- [PacerProviderOptions](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/PacerProviderOptions.md)
- [PacerProviderProps](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/PacerProviderProps.md)
- [PreactBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/PreactBatcher.md)
- [PreactDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/PreactDebouncer.md)
- [PreactQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/PreactQueuer.md)
- [PreactRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/PreactRateLimiter.md)
- [PreactThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/PreactThrottler.md)
- [ReactAsyncBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/ReactAsyncBatcher.md)
- [ReactAsyncDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/ReactAsyncDebouncer.md)
- [ReactAsyncQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/ReactAsyncQueuer.md)
- [ReactAsyncRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/ReactAsyncRateLimiter.md)
- [ReactAsyncThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/interfaces/ReactAsyncThrottler.md)
- [PacerProvider](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/PacerProvider.md)
- [useAsyncBatchedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncBatchedCallback.md)
- [useAsyncBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncBatcher.md)
- [useAsyncDebouncedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncDebouncedCallback.md)
- [useAsyncDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncDebouncer.md)
- [useAsyncQueuedState](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncQueuedState.md)
- [useAsyncQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncQueuer.md)
- [useAsyncRateLimitedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncRateLimitedCallback.md)
- [useAsyncRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncRateLimiter.md)
- [useAsyncThrottledCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncThrottledCallback.md)
- [useAsyncThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useAsyncThrottler.md)
- [useBatchedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useBatchedCallback.md)
- [useBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useBatcher.md)
- [useDebouncedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useDebouncedCallback.md)
- [useDebouncedState](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useDebouncedState.md)
- [useDebouncedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useDebouncedValue.md)
- [useDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useDebouncer.md)
- [useDefaultPacerOptions](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useDefaultPacerOptions.md)
- [usePacerContext](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/usePacerContext.md)
- [useQueuedState](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useQueuedState.md)
- [useQueuedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useQueuedValue.md)
- [useQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useQueuer.md)
- [useRateLimitedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useRateLimitedCallback.md)
- [useRateLimitedState](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useRateLimitedState.md)
- [useRateLimitedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useRateLimitedValue.md)
- [useRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useRateLimiter.md)
- [useThrottledCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useThrottledCallback.md)
- [useThrottledState](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useThrottledState.md)
- [useThrottledValue](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useThrottledValue.md)
- [useThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/preact/reference/functions/useThrottler.md)

--- docs/framework/react/reference/index.md ---
---
id: "@tanstack/react-pacer"
title: "@tanstack/react-pacer"
---

# @tanstack/react-pacer

## Interfaces

- [PacerProviderOptions](interfaces/PacerProviderOptions.md)
- [PacerProviderProps](interfaces/PacerProviderProps.md)
- [ReactAsyncBatcher](interfaces/ReactAsyncBatcher.md)
- [ReactAsyncDebouncer](interfaces/ReactAsyncDebouncer.md)
- [ReactAsyncQueuer](interfaces/ReactAsyncQueuer.md)
- [ReactAsyncRateLimiter](interfaces/ReactAsyncRateLimiter.md)
- [ReactAsyncThrottler](interfaces/ReactAsyncThrottler.md)
- [ReactBatcher](interfaces/ReactBatcher.md)
- [ReactDebouncer](interfaces/ReactDebouncer.md)
- [ReactQueuer](interfaces/ReactQueuer.md)
- [ReactRateLimiter](interfaces/ReactRateLimiter.md)
- [ReactThrottler](interfaces/ReactThrottler.md)

## Functions

- [PacerProvider](functions/PacerProvider.md)
- [useAsyncBatchedCallback](functions/useAsyncBatchedCallback.md)
- [useAsyncBatcher](functions/useAsyncBatcher.md)
- [useAsyncDebouncedCallback](functions/useAsyncDebouncedCallback.md)
- [useAsyncDebouncer](functions/useAsyncDebouncer.md)
- [useAsyncQueuedState](functions/useAsyncQueuedState.md)
- [useAsyncQueuer](functions/useAsyncQueuer.md)
- [useAsyncRateLimitedCallback](functions/useAsyncRateLimitedCallback.md)
- [useAsyncRateLimiter](functions/useAsyncRateLimiter.md)
- [useAsyncThrottledCallback](functions/useAsyncThrottledCallback.md)
- [useAsyncThrottler](functions/useAsyncThrottler.md)
- [useBatchedCallback](functions/useBatchedCallback.md)
- [useBatcher](functions/useBatcher.md)
- [useDebouncedCallback](functions/useDebouncedCallback.md)
- [useDebouncedState](functions/useDebouncedState.md)
- [useDebouncedValue](functions/useDebouncedValue.md)
- [useDebouncer](functions/useDebouncer.md)
- [useDefaultPacerOptions](functions/useDefaultPacerOptions.md)
- [usePacerContext](functions/usePacerContext.md)
- [useQueuedState](functions/useQueuedState.md)
- [useQueuedValue](functions/useQueuedValue.md)
- [useQueuer](functions/useQueuer.md)
- [useRateLimitedCallback](functions/useRateLimitedCallback.md)
- [useRateLimitedState](functions/useRateLimitedState.md)
- [useRateLimitedValue](functions/useRateLimitedValue.md)
- [useRateLimiter](functions/useRateLimiter.md)
- [useThrottledCallback](functions/useThrottledCallback.md)
- [useThrottledState](functions/useThrottledState.md)
- [useThrottledValue](functions/useThrottledValue.md)
- [useThrottler](functions/useThrottler.md)


## Links discovered
- [PacerProviderOptions](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/PacerProviderOptions.md)
- [PacerProviderProps](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/PacerProviderProps.md)
- [ReactAsyncBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactAsyncBatcher.md)
- [ReactAsyncDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactAsyncDebouncer.md)
- [ReactAsyncQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactAsyncQueuer.md)
- [ReactAsyncRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactAsyncRateLimiter.md)
- [ReactAsyncThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactAsyncThrottler.md)
- [ReactBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactBatcher.md)
- [ReactDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactDebouncer.md)
- [ReactQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactQueuer.md)
- [ReactRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactRateLimiter.md)
- [ReactThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/interfaces/ReactThrottler.md)
- [PacerProvider](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/PacerProvider.md)
- [useAsyncBatchedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncBatchedCallback.md)
- [useAsyncBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncBatcher.md)
- [useAsyncDebouncedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncDebouncedCallback.md)
- [useAsyncDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncDebouncer.md)
- [useAsyncQueuedState](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncQueuedState.md)
- [useAsyncQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncQueuer.md)
- [useAsyncRateLimitedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncRateLimitedCallback.md)
- [useAsyncRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncRateLimiter.md)
- [useAsyncThrottledCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncThrottledCallback.md)
- [useAsyncThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useAsyncThrottler.md)
- [useBatchedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useBatchedCallback.md)
- [useBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useBatcher.md)
- [useDebouncedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useDebouncedCallback.md)
- [useDebouncedState](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useDebouncedState.md)
- [useDebouncedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useDebouncedValue.md)
- [useDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useDebouncer.md)
- [useDefaultPacerOptions](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useDefaultPacerOptions.md)
- [usePacerContext](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/usePacerContext.md)
- [useQueuedState](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useQueuedState.md)
- [useQueuedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useQueuedValue.md)
- [useQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useQueuer.md)
- [useRateLimitedCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useRateLimitedCallback.md)
- [useRateLimitedState](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useRateLimitedState.md)
- [useRateLimitedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useRateLimitedValue.md)
- [useRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useRateLimiter.md)
- [useThrottledCallback](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useThrottledCallback.md)
- [useThrottledState](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useThrottledState.md)
- [useThrottledValue](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useThrottledValue.md)
- [useThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/react/reference/functions/useThrottler.md)

--- docs/framework/solid/reference/index.md ---
---
id: "@tanstack/solid-pacer"
title: "@tanstack/solid-pacer"
---

# @tanstack/solid-pacer

## Interfaces

- [PacerProviderOptions](interfaces/PacerProviderOptions.md)
- [PacerProviderProps](interfaces/PacerProviderProps.md)
- [SolidAsyncBatcher](interfaces/SolidAsyncBatcher.md)
- [SolidAsyncDebouncer](interfaces/SolidAsyncDebouncer.md)
- [SolidAsyncQueuer](interfaces/SolidAsyncQueuer.md)
- [SolidAsyncRateLimiter](interfaces/SolidAsyncRateLimiter.md)
- [SolidAsyncThrottler](interfaces/SolidAsyncThrottler.md)
- [SolidBatcher](interfaces/SolidBatcher.md)
- [SolidDebouncer](interfaces/SolidDebouncer.md)
- [SolidQueuer](interfaces/SolidQueuer.md)
- [SolidRateLimiter](interfaces/SolidRateLimiter.md)
- [SolidThrottler](interfaces/SolidThrottler.md)

## Functions

- [createAsyncBatcher](functions/createAsyncBatcher.md)
- [createAsyncDebouncer](functions/createAsyncDebouncer.md)
- [createAsyncQueuer](functions/createAsyncQueuer.md)
- [createAsyncRateLimiter](functions/createAsyncRateLimiter.md)
- [createAsyncThrottler](functions/createAsyncThrottler.md)
- [createBatcher](functions/createBatcher.md)
- [createDebouncedSignal](functions/createDebouncedSignal.md)
- [createDebouncedValue](functions/createDebouncedValue.md)
- [createDebouncer](functions/createDebouncer.md)
- [createQueuedSignal](functions/createQueuedSignal.md)
- [createQueuer](functions/createQueuer.md)
- [createRateLimitedSignal](functions/createRateLimitedSignal.md)
- [createRateLimitedValue](functions/createRateLimitedValue.md)
- [createRateLimiter](functions/createRateLimiter.md)
- [createThrottledSignal](functions/createThrottledSignal.md)
- [createThrottledValue](functions/createThrottledValue.md)
- [createThrottler](functions/createThrottler.md)
- [PacerProvider](functions/PacerProvider.md)
- [useDefaultPacerOptions](functions/useDefaultPacerOptions.md)
- [usePacerContext](functions/usePacerContext.md)


## Links discovered
- [PacerProviderOptions](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/PacerProviderOptions.md)
- [PacerProviderProps](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/PacerProviderProps.md)
- [SolidAsyncBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidAsyncBatcher.md)
- [SolidAsyncDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidAsyncDebouncer.md)
- [SolidAsyncQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidAsyncQueuer.md)
- [SolidAsyncRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidAsyncRateLimiter.md)
- [SolidAsyncThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidAsyncThrottler.md)
- [SolidBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidBatcher.md)
- [SolidDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidDebouncer.md)
- [SolidQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidQueuer.md)
- [SolidRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidRateLimiter.md)
- [SolidThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/interfaces/SolidThrottler.md)
- [createAsyncBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createAsyncBatcher.md)
- [createAsyncDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createAsyncDebouncer.md)
- [createAsyncQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createAsyncQueuer.md)
- [createAsyncRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createAsyncRateLimiter.md)
- [createAsyncThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createAsyncThrottler.md)
- [createBatcher](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createBatcher.md)
- [createDebouncedSignal](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createDebouncedSignal.md)
- [createDebouncedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createDebouncedValue.md)
- [createDebouncer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createDebouncer.md)
- [createQueuedSignal](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createQueuedSignal.md)
- [createQueuer](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createQueuer.md)
- [createRateLimitedSignal](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createRateLimitedSignal.md)
- [createRateLimitedValue](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createRateLimitedValue.md)
- [createRateLimiter](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createRateLimiter.md)
- [createThrottledSignal](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createThrottledSignal.md)
- [createThrottledValue](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createThrottledValue.md)
- [createThrottler](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/createThrottler.md)
- [PacerProvider](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/PacerProvider.md)
- [useDefaultPacerOptions](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/useDefaultPacerOptions.md)
- [usePacerContext](https://github.com/tanstack/pacer/blob/main/docs/framework/solid/reference/functions/usePacerContext.md)

--- docs/devtools.md ---
---
title: Devtools
id: devtools
---

What? My debouncer can have dedicated devtools? Yep!

TanStack Pacer provides devtools for debugging and monitoring all your utilities in real-time. The devtools integrate seamlessly within the new [TanStack Devtools](https://tanstack.com/devtools) multi-panel UI.

> [!NOTE] 
> By default, the TanStack Devtools and TanStack Pacer Devtools will only be included in development mode. This helps keep your production bundle size minimal. If you need to include devtools in production builds (e.g., for debugging production issues), you can use the alternative "production" imports.

## Installation

Install the devtools packages for your framework:

### React

```sh
npm install @tanstack/react-devtools @tanstack/react-pacer-devtools
```

### Solid

```sh
npm install @tanstack/solid-devtools @tanstack/solid-pacer-devtools
```

## Basic Setup

### React Setup

```tsx
import { TanStackDevtools } from '@tanstack/react-devtools'
import { pacerDevtoolsPlugin } from '@tanstack/react-pacer-devtools'

function App() {
  return (
    <div>
      {/* Your app content */}
      
      <TanStackDevtools
        eventBusConfig={{
          debug: false,
        }}
        plugins={[pacerDevtoolsPlugin()]}
      />
    </div>
  )
}
```

### Solid Setup

```tsx
import { TanStackDevtools } from '@tanstack/solid-devtools'
import { pacerDevtoolsPlugin } from '@tanstack/solid-pacer-devtools'

function App() {
  return (
    <div>
      {/* Your app content */}
      
      <TanStackDevtools
        eventBusConfig={{
          debug: false,
        }}
        plugins={[pacerDevtoolsPlugin()]}
      />
    </div>
  )
}
```

## Production Builds

By default, devtools are excluded from production builds to minimize bundle size. The default imports will return no-op implementations in production:

```tsx
// This will be a no-op in production builds
import { pacerDevtoolsPlugin } from '@tanstack/react-pacer-devtools'
```

If you need to include devtools in production builds (e.g., for debugging production issues), use the production-specific imports:

```tsx
// This will include full devtools even in production builds
import { pacerDevtoolsPlugin } from '@tanstack/react-pacer-devtools/production'
```

## Registering Utilities

Pacer utilities only register with the devtools when you pass a `key`. Keys are no longer generated automatically, so leave the option out if you do not want an instance to appear in the panels.

```tsx
const debouncer = new Debouncer(myDebounceFn, {
  key: 'My Debouncer', // friendly name shown in the devtools
  wait: 1000,
})
```

## Links discovered
- [TanStack Devtools](https://tanstack.com/devtools)

--- scripts/generate-docs.ts ---
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { generateReferenceDocs } from '@tanstack/typedoc-config'

const __dirname = fileURLToPath(new URL('.', import.meta.url))

await generateReferenceDocs({
  packages: [
    {
      name: 'pacer',
      entryPoints: [resolve(__dirname, '../packages/pacer/src/index.ts')],
      tsconfig: resolve(__dirname, '../packages/pacer/tsconfig.docs.json'),
      outputDir: resolve(__dirname, '../docs/reference'),
    },
    {
      name: 'preact-pacer',
      entryPoints: [
        resolve(__dirname, '../packages/preact-pacer/src/index.ts'),
      ],
      tsconfig: resolve(
        __dirname,
        '../packages/preact-pacer/tsconfig.docs.json',
      ),
      outputDir: resolve(__dirname, '../docs/framework/preact/reference'),
      exclude: ['packages/pacer/**/*'],
    },
    {
      name: 'react-pacer',
      entryPoints: [resolve(__dirname, '../packages/react-pacer/src/index.ts')],
      tsconfig: resolve(
        __dirname,
        '../packages/react-pacer/tsconfig.docs.json',
      ),
      outputDir: resolve(__dirname, '../docs/framework/react/reference'),
      exclude: ['packages/pacer/**/*'],
    },
    {
      name: 'solid-pacer',
      entryPoints: [resolve(__dirname, '../packages/solid-pacer/src/index.ts')],
      tsconfig: resolve(
        __dirname,
        '../packages/solid-pacer/tsconfig.docs.json',
      ),
      outputDir: resolve(__dirname, '../docs/framework/solid/reference'),
      exclude: ['packages/pacer/**/*'],
    },
  ],
})

console.log('\n✅ All markdown files have been processed!')

process.exit(0)


--- docs/quick-start.md ---
---
title: Quick Start
id: quick-start
---

## Installation

Don't have TanStack Pacer installed yet? See the [Installation](./installation.md) page for instructions.

## Understanding Which Pacer Utility to Use

Still learning what TanStack Pacer is and how it can help your application? See the [Which Pacer Utility Should I Choose?](./guides/which-pacer-utility-should-i-choose.md) guide for help choosing which Pacer utility to use. The TanStack Pacer libraries have 5 core utilities, but also quite a few flexible ways to use each utility. Famarilizing yourself with the above guide will help you choose the right utility for your use case.

## API References

See the [API References](./reference/index.md) page for the full list of API references for each Pacer utility.

## Basic Usage

If you are using vanilla JavaScript, there are core classes and functions that you can use from the core pacer package.

### Class Usage

```ts
import { Debouncer } from '@tanstack/pacer' // class

const debouncer = new Debouncer(fn, options)

debouncer.maybeExecute(args) // execute the debounced function
debouncer.cancel() // cancel the debounced function
debouncer.flush() // flush the debounced function
```

### Function Usage

```ts
import { debounce } from '@tanstack/pacer' // function

const debouncedFn = debounce(fn, options)

debouncedFn(args) // execute the debounced function
```

### Framework Hook Usage (Recommended)

If you are using a framework adapter like React, you can use the `useDebouncer` hook to create a debounced function.

```tsx
import { useDebouncer } from '@tanstack/react-pacer'

const debouncer = useDebouncer(fn, options) // recommended

debouncer.maybeExecute(args) // execute the debounced function
debouncer.cancel() // cancel the debounced function
debouncer.flush() // flush the debounced function
```

### Option Helpers

If want a type-safe way to define common options for pacer utilities, TanStack Pacer provides option helpers for each utility.

```ts
import { debouncerOptions } from '@tanstack/pacer'

const commonDebouncerOptions = debouncerOptions({
  wait: 1000,
  leading: false,
  trailing: true,
})

const debouncer = new Debouncer(fn, { ...commonDebouncerOptions, key: 'myDebouncer' })
```

### Providers

In each framework adapter, there is a provider component that you can use to provide default options to all instances of a pacer utility.

```tsx
import { PacerProvider } from '@tanstack/react-pacer'

// set default options for react-pacer instances
<PacerProvider defaultOptions={{ debouncer: { wait: 1000 } }}>
  <App />
</PacerProvider>
```

### Devtools

TanStack Pacer provides an official TanStack Devtools integration for each framework adapter. See the [Devtools](./devtools.md) documentation for more information on how to set up and use the Pacer devtools.

## Links discovered
- [Installation](https://github.com/tanstack/pacer/blob/main/docs/installation.md)
- [Which Pacer Utility Should I Choose?](https://github.com/tanstack/pacer/blob/main/docs/guides/which-pacer-utility-should-i-choose.md)
- [API References](https://github.com/tanstack/pacer/blob/main/docs/reference/index.md)
- [Devtools](https://github.com/tanstack/pacer/blob/main/docs/devtools.md)

--- docs/guides/async-batching.md ---
---
title: Async Batching Guide
id: async-batching
---

All core concepts from the [Batching Guide](./batching.md) apply to async batching as well.

## When to Use Async Batching

While the synchronous batcher works well for many use cases, async batching provides additional capabilities that are particularly useful when:

- You need to capture and use the return value from batch executions
- Your batch processing involves asynchronous operations (API calls, database operations, file I/O)
- You require advanced error handling with configurable error behavior
- You want to track success/error statistics separately
- You need to monitor when batches are actively executing

## Async Batching in TanStack Pacer

TanStack Pacer provides async batching through the `AsyncBatcher` class and the `asyncBatch` function. Unlike the synchronous version, the async batcher handles Promises and provides robust error handling capabilities.

### Basic Usage with `asyncBatch`

The `asyncBatch` function provides a simple way to create an async batching function:

```ts
import { asyncBatch } from '@tanstack/pacer'

const processAsyncBatch = asyncBatch<number>(
  async (items) => {
    // Process the batch asynchronously
    const results = await Promise.all(
      items.map(item => processApiCall(item))
    )
    return results
  },
  {
    maxSize: 3,
    wait: 2000,
    onSuccess: (results, batch, batcher) => {
      console.log('Batch completed successfully:', results)
      console.log('Processed batch:', batch)
      console.log('Total successes:', batcher.store.state.successCount)
    },
    onError: (error, batch, batcher) => {
      console.error('Batch failed:', error)
      console.log('Failed batch:', batch)
      console.log('Total errors:', batcher.store.state.errorCount)
    }
  }
)

// Add items to be batched
processAsyncBatch(1)
processAsyncBatch(2)
processAsyncBatch(3) // Triggers batch processing
```

> **Note:** When using React, prefer `useAsyncBatchedCallback` hook over the `asyncBatch` function for better integration with React's lifecycle and automatic cleanup.

### Advanced Usage with `AsyncBatcher` Class

For more control over async batch behavior, use the `AsyncBatcher` class directly:

```ts
import { AsyncBatcher } from '@tanstack/pacer'

const batcher = new AsyncBatcher<number>(
  async (items) => {
    // Process the batch asynchronously
    const results = await Promise.all(
      items.map(item => processApiCall(item))
    )
    return results
  },
  {
    maxSize: 5,
    wait: 3000,
    onSuccess: (results, batch, batcher) => {
      console.log('Batch succeeded:', results)
      console.log('Processed batch:', batch)
    },
    onError: (error, batch, batcher) => {
      console.error('Batch failed:', error)
      console.log('Failed batch:', batch)
    }
  }
)

// Access current state via TanStack Store
console.log(batcher.store.state.successCount) // Number of successful batch executions
console.log(batcher.store.state.errorCount) // Number of failed batch executions
console.log(batcher.store.state.isExecuting) // Whether a batch is currently executing
console.log(batcher.store.state.lastResult) // Result from most recent batch

// Add items to the batch
batcher.addItem(1)
batcher.addItem(2)

// Control batch execution
batcher.stop()  // Stop processing
batcher.start() // Resume processing
```

## Key Differences from Synchronous Batching

### 1. Return Value Handling

Unlike the synchronous batcher which returns void, the async version allows you to capture and use the return value from your batch function:

```ts
const batcher = new AsyncBatcher<string>(
  async (items) => {
    const results = await processBatch(items)
    return results
  },
  {
    maxSize: 5,
    onSuccess: (results, batch, batcher) => {
      // Handle the returned results
      console.log('Batch results:', results)
      console.log('Processed batch:', batch)
    }
  }
)
```

### 2. Error Handling

The async batcher provides comprehensive error handling capabilities:

```ts
const batcher = new AsyncBatcher<number>(
  async (items) => {
    // This might throw an error
    const results = await riskyBatchOperation(items)
    return results
  },
  {
    maxSize: 3,
    onError: (error, batch, batcher) => {
      // Handle batch errors
      console.error('Batch processing failed:', error)
      console.log('Items that failed:', batch)
      console.log('Total error count:', batcher.store.state.errorCount)
    },
    throwOnError: false, // Don't throw errors, just handle them
    onSuccess: (results, batch, batcher) => {
      console.log('Batch succeeded:', results)
      console.log('Processed batch:', batch)
      console.log('Total success count:', batcher.store.state.successCount)
    },
    onSettled: (batch, batcher) => {
      // Called after every batch (success or failure)
      console.log('Batch settled:', batch)
      console.log('Total batches:', batcher.store.state.settleCount)
    }
  }
)
```

### 3. Execution State Tracking

The async batcher tracks when batches are actively executing:

```ts
const batcher = new AsyncBatcher<number>(
  async (items) => {
    console.log('Starting batch execution...')
    const results = await longRunningBatchOperation(items)
    console.log('Batch execution completed')
    return results
  },
  {
    maxSize: 5,
    onItemsChange: (batcher) => {
      console.log('Is executing:', batcher.store.state.isExecuting)
      console.log('Items in queue:', batcher.store.state.size)
    }
  }
)
```

### 4. Different Callbacks

The `AsyncBatcher` supports these async-specific callbacks:

- `onSuccess`: Called after each successful batch execution, providing the result, the batch of items processed, and batcher instance
- `onError`: Called when a batch execution fails, providing the error, the batch of items that failed, and batcher instance
- `onSettled`: Called after each batch execution (success or failure), providing the batch of items processed and batcher instance
- `onExecute`: Called after each batch execution, providing the batch of items processed and batcher instance (same as synchronous batcher)
- `onItemsChange`: Called when items are added or the batch is processed

## Advanced Features: Retry and Abort Support

The async batcher includes built-in retry and abort capabilities through integration with `AsyncRetryer`. These features help handle transient failures and provide control over in-flight operations.

### Retry Support

Configure automatic retries for failed batch executions using the `asyncRetryerOptions`:

```ts
const batcher = new AsyncBatcher<number>(
  async (items) => {
    // This might fail due to network issues
    const results = await apiCall(items)
    return results
  },
  {
    maxSize: 5,
    asyncRetryerOptions: {
      maxAttempts: 3,
      backoff: 'exponential',
      baseWait: 1000,
      maxWait: 10000,
      jitter: 0.3
    }
  }
)
```

For complete documentation on retry strategies, backoff algorithms, jitter, and advanced retry patterns, see the [Async Retrying Guide](./async-retrying.md).

### Abort Support

Cancel in-flight batch executions using the abort functionality:

```ts
const batcher = new AsyncBatcher<number>(
  async (items) => {
    // Access the abort signal for this execution
    const signal = batcher.getAbortSignal()
    if (signal) {
      const response = await fetch('/api/batch', {
        method: 'POST',
        body: JSON.stringify(items),
        signal // Pass signal to fetch for cancellation support
      })
      return response.json()
    }
  },
  { maxSize: 10 }
)

// Add items
batcher.addItem(1)
batcher.addItem(2)

// Later, abort any in-flight batch executions
batcher.abort()
```

The abort functionality:
- Cancels all ongoing batch executions using AbortController
- Does NOT cancel pending batches that haven't started yet (use `cancel()` for that)
- Does NOT clear items from the batcher
- Can be used alongside retry support

For more details on abort patterns and integration with fetch/axios, see the [Async Retrying Guide](./async-retrying.md).

### Sharing Options Between Instances

Use `asyncBatcherOptions` to share common options between different `AsyncBatcher` instances:

```ts
import { asyncBatcherOptions, AsyncBatcher } from '@tanstack/pacer'

const sharedOptions = asyncBatcherOptions({
  maxSize: 5,
  wait: 2000,
  onSuccess: (results, batch, batcher) => console.log('Success')
})

const batcher1 = new AsyncBatcher(fn1, { ...sharedOptions, key: 'batcher1' })
const batcher2 = new AsyncBatcher(fn2, { ...sharedOptions, maxSize: 10 })
```

## Error Handling Options

The async batcher provides flexible error handling through the `throwOnError` option:

```ts
const batcher = new AsyncBatcher<number>(
  async (items) => {
    // This might throw an error
    throw new Error('Batch processing failed')
  },
  {
    maxSize: 3,
    onError: (error, batch, batcher) => {
      console.error('Handling error:', error)
    },
    throwOnError: true, // Will throw errors even with onError handler
    // throwOnError: false, // Will swallow errors (default if onError is provided)
    // throwOnError: undefined, // Uses default behavior based on onError presence
  }
)
```

- **Default behavior**: `throwOnError` is `true` if no `onError` handler is provided, `false` if an `onError` handler is provided
- **With `onError` handler**: The handler is called first, then the error is thrown if `throwOnError` is `true`
- **Error state**: Failed items are tracked in `failedItems` array and can be accessed via `peekFailedItems()`. The `onError` callback receives the batch of items that failed, not the accumulated failed items.

## Dynamic Options

Like the synchronous batcher, the async batcher supports dynamic options:

```ts
const batcher = new AsyncBatcher<number>(
  async (items) => {
    return await processBatch(items)
  },
  {
    // Dynamic batch size based on success rate
    maxSize: (batcher) => {
      const successRate = batcher.store.state.successCount / Math.max(1, batcher.store.state.settleCount)
      return successRate > 0.8 ? 10 : 5 // Larger batches if success rate is high
    },
    // Dynamic wait time based on error count
    wait: (batcher) => {
      return batcher.store.state.errorCount > 5 ? 5000 : 2000 // Wait longer if errors are frequent
    }
  }
)
```

### Flushing Pending Batches

The async batcher supports flushing pending batches to trigger processing immediately:

```ts
const batcher = new AsyncBatcher(asyncBatchFn, { maxSize: 10, wait: 5000 })

batcher.addItem('item1')
batcher.addItem('item2')
console.log(batcher.store.state.isPending) // true

// Flush immediately instead of waiting
const result = await batcher.flush()
console.log('Flush result:', result)
console.log(batcher.store.state.isEmpty) // true (batch was processed)
```

## State Management

The `AsyncBatcher` class uses TanStack Store for reactive state management, providing real-time access to batch execution state, error tracking, and processing statistics. All state is stored in a TanStack Store and can be accessed via `asyncBatcher.store.state`, although, if you are using a framework adapter like React or Solid, you will not want to read the state from here. Instead, you will read the state from `asyncBatcher.state` along with providing a selector callback as the 3rd argument to the `useAsyncBatcher` hook to opt-in to state tracking as shown below.

### State Selector (Framework Adapters)

Framework adapters support a `selector` argument that allows you to specify which state changes will trigger re-renders. This optimizes performance by preventing unnecessary re-renders when irrelevant state changes occur.

**By default, `asyncBatcher.state` is empty (`{}`) as the selector is empty by default.** This is where reactive state from a TanStack Store `useStore` gets stored. You must opt-in to state tracking by providing a selector function.

```ts
// Default behavior - no reactive state subscriptions
const batcher = useAsyncBatcher(asyncBatchFn, { maxSize: 5, wait: 1000 })
console.log(batcher.state) // {}

// Opt-in to re-render when isExecuting changes
const batcher = useAsyncBatcher(
  asyncBatchFn, 
  { maxSize: 5, wait: 1000 },
  (state) => ({ isExecuting: state.isExecuting })
)
console.log(batcher.state.isExecuting) // Reactive value

// Multiple state properties
const batcher = useAsyncBatcher(
  asyncBatchFn,
  { maxSize: 5, wait: 1000 },
  (state) => ({
    isExecuting: state.isExecuting,
    successCount: state.successCount,
    errorCount: state.errorCount
  })
)
```

### Initial State

You can provide initial state values when creating an async batcher. This is commonly used to restore state from persistent storage:

```ts
// Load initial state from localStorage
const savedState = localStorage.getItem('async-batcher-state')
const initialState = savedState ? JSON.parse(savedState) : {}

const batcher = new AsyncBatcher(asyncBatchFn, {
  maxSize: 5,
  wait: 1000,
  initialState
})
```

### Subscribing to State Changes

The store is reactive and supports subscriptions:

```ts
const batcher = new AsyncBatcher(asyncBatchFn, { maxSize: 5, wait: 1000 })

// Subscribe to state changes
const unsubscribe = batcher.store.subscribe((state) => {
  // do something with the state like persist it to localStorage
})

// Unsubscribe when done
unsubscribe()
```

> **Note:** This is unnecessary when using a framework adapter because the underlying `useStore` hook already does this. You can also import and use `useStore` from TanStack Store to turn `batcher.store.state` into reactive state with a custom selector wherever you want if necessary.

```ts
const batcher = useAsyncBatcher(asyncBatchFn, { maxSize: 5, wait: 1000 })

// you could manually use the `useStore` hook to subscribe to state changes in whatever scope you want
const state = useStore(batcher.store, (state) => ({
  successCount: state.successCount,
}))

console.log(state)
```

### Available State Properties

The `AsyncBatcherState` includes:

- `errorCount`: Number of batch executions that have resulted in errors
- `failedItems`: Array of items that failed during batch processing
- `isEmpty`: Whether the batcher has no items to process (items array is empty)
- `isExecuting`: Whether a batch is currently being processed asynchronously
- `isPending`: Whether the batcher is waiting for the timeout to trigger batch processing
- `items`: Array of items currently queued for batch processing
- `lastResult`: The result from the most recent batch execution
- `settleCount`: Number of batch executions that have completed (either successfully or with errors)
- `size`: Number of items currently in the batch queue
- `status`: Current processing status ('idle' | 'pending' | 'executing' | 'populated')
- `successCount`: Number of batch executions that have completed successfully
- `totalItemsFailed`: Total number of items that have failed processing across all batches
- `totalItemsProcessed`: Total number of items that have been processed across all batches

### Monitoring Failed Items

The async batcher tracks items that failed during batch processing:

```ts
const batcher = new AsyncBatcher<number>(
  async (items) => {
    // This might fail for some items
    if (items.some(item => item < 0)) {
      throw new Error('Negative numbers not allowed')
    }
    return await processBatch(items)
  },
  {
    maxSize: 3,
    onError: (error, batch, batcher) => {
      console.log('Failed batch:', batch)
      console.log('All failed items:', batcher.peekFailedItems())
    }
  }
)
```

## Framework Adapters

Each framework adapter provides hooks that build on top of the core async batching functionality to integrate with the framework's state management system. Hooks like `useAsyncBatcher` or similar are available for each framework.

---

For core batching concepts and synchronous batching, see the [Batching Guide](./batching.md).

## Links discovered
- [Batching Guide](https://github.com/tanstack/pacer/blob/main/docs/guides/batching.md)
- [Async Retrying Guide](https://github.com/tanstack/pacer/blob/main/docs/guides/async-retrying.md)

--- examples/preact/asyncBatch/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/asyncDebounce/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/asyncRateLimit/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/asyncRetry/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/asyncThrottle/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/batch/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/debounce/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/queue/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/rateLimit/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- examples/preact/throttle/README.md ---
# Example

To run this example:

- `npm install`
- `npm run dev`


--- CONTRIBUTING.md ---
---
title: Contributing
id: contributing
---

# Contributing

## Questions

If you have questions about implementation details, help or support, then please use our dedicated community forum at [Github Discussions](https://github.com/tanstack/pacer/discussions) **PLEASE NOTE:** If you choose to instead open an issue for your question, your issue will be immediately closed and redirected to the forum.

## Reporting Issues

If you have found what you think is a bug, please [file an issue](https://github.com/tanstack/pacer/issues/new). **PLEASE NOTE:** Issues that are identified as implementation questions or non-issues will be immediately closed and redirected to [Github Discussions](https://github.com/tanstack/pacer/discussions)

## Suggesting new features

If you are here to suggest a feature, first create an issue if it does not already exist. From there, we will discuss use-cases for the feature and then finally discuss how it could be implemented.

## Development

Before proceeding with development, ensure you match one of the following criteria:

- Fixing a small bug
- Fixing a larger issue that has been previously discussed and agreed-upon by maintainers
- Adding a new feature that has been previously discussed and agreed-upon by maintainers

## Development Workflow

- Fork this repository, we prefer the `feat-*` branch name style
- Ensure you have `pnpm` installed
- Install projects dependencies and linkages by running `pnpm install`
- Auto-build and auto-test files as you edit by running `pnpm dev`
- Implement your changes and tests
- To run examples, follow their individual directions. Usually this includes:
  - cd into the example directory
  - Do NOT install dependencies again or do any linking. Nx already handles this for you. Only run install from the project root.
  - Starting the dev server with `pnpm dev` or `pnpm start` (from the example directory)
- To test in your own projects:
  - Build/watch for changes with `pnpm build`/`pnpm dev`
- Document your changes in the appropriate documentation website markdown pages
- Run `pnpm test` to ensure all tests pass before committing
- Create a changeset (changelog entry) for your changes by running `pnpm changeset`
- Commit your work and open a pull request
- Submit PR for review

## Adding a new example

- Clone an existing example into the appropriate `examples` directory
- Name it the example name in kebab-case
- Update the new example's package.json to match the new example name and any other details
- Check dependencies for unused packages
- Install any additional packages to the example that you may need
- Update the docs/config.json file to include the new example in the navigation sidebar
- Commit the example eg. `docs: Add example-name`


## Links discovered
- [Github Discussions](https://github.com/tanstack/pacer/discussions)
- [file an issue](https://github.com/tanstack/pacer/issues/new)

--- packages/pacer-devtools/CHANGELOG.md ---
# @tanstack/pacer-devtools

## 1.1.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

## 1.0.1

### Patch Changes

- build: migrate to tsdown ([#113](https://github.com/TanStack/pacer/pull/113))

- Updated dependencies [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)]:
  - @tanstack/pacer@0.16.4

## 1.0.0

### Minor Changes

- - feat:Added `AsyncRetryer` class and `asyncRetry` function with exponential/linear/fixed backoff strategies, jitter support, timeout controls (`maxExecutionTime`, `maxTotalExecutionTime`), lifecycle callbacks (`onRetry`, `onSuccess`, `onError`, `onLastError`, `onSettled`, `onAbort`, `onExecutionTimeout`, `onTotalExecutionTimeout`), dynamic options, and built-in retry integration via `asyncRetryerOptions` for all async utilities (`AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) ([#54](https://github.com/TanStack/pacer/pull/54))
  - feat: Added `getAbortSignal()` method to all async utilities (`AsyncRetryer`, `AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) to enable true cancellation of underlying async operations (like fetch requests) when `abort()` is called
  - feat: Added `asyncBatcherOptions`, `asyncDebouncerOptions`, `asyncQueuerOptions`, `asyncRateLimiterOptions`, `asyncRetryerOptions`, `asyncThrottlerOptions`, `debouncerOptions`, `queuerOptions`, `rateLimiterOptions`, `throttlerOptions` utility functions for sharing common options between different pacer utilities
  - fix: Fixed async-throtter trailing edge behavior when long executions were awaited.
  - breaking: standardized `reset`, `cancel` and `abort` API behaviors with consistent naming and behavior across all async utilities. Canceling no longer aborts, new dedicated `abort` method is provided for aborting ongoing executions.

### Patch Changes

- Updated dependencies [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)]:
  - @tanstack/pacer@0.16.0

## 0.3.1

### Patch Changes

- update pacer devtools to use devtools-utils to avoid common issues in user projects ([#80](https://github.com/TanStack/pacer/pull/80))

## 0.3.0

### Minor Changes

- Added light/dark mode support to Pacer devtools, updated to latest versions of underlying devtools packages and added plugins in favor of users manually defining the panels ([#62](https://github.com/TanStack/pacer/pull/62))

## 0.2.0

### Minor Changes

- Dropped CJS support, added consistency to styling ([#59](https://github.com/TanStack/pacer/pull/59))

## 0.1.0

### Minor Changes

- feat: added pacer devtools ([`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b))

### Patch Changes

- Updated dependencies [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)]:
  - @tanstack/pacer@0.15.0


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [#113](https://github.com/TanStack/pacer/pull/113)
- [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)
- [#54](https://github.com/TanStack/pacer/pull/54)
- [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)
- [#80](https://github.com/TanStack/pacer/pull/80)
- [#62](https://github.com/TanStack/pacer/pull/62)
- [#59](https://github.com/TanStack/pacer/pull/59)
- [`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)

--- packages/pacer-lite/CHANGELOG.md ---
# @tanstack/pacer-lite

## 0.2.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

## 0.1.1

### Patch Changes

- build: migrate to tsdown ([#113](https://github.com/TanStack/pacer/pull/113))

## 0.1.0

### Minor Changes

- feat: add pacer-lite library ([#100](https://github.com/TanStack/pacer/pull/100))


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [#113](https://github.com/TanStack/pacer/pull/113)
- [#100](https://github.com/TanStack/pacer/pull/100)

--- packages/pacer/CHANGELOG.md ---
# @tanstack/pacer

## 0.17.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

## 0.16.4

### Patch Changes

- build: migrate to tsdown ([#113](https://github.com/TanStack/pacer/pull/113))

## 0.16.3

### Patch Changes

- fix: ignore eventClient when no key is specified ([`9893832`](https://github.com/TanStack/pacer/commit/98938323f0bc1a6ab87bce72287c6d4a7264cb93))

## 0.16.2

### Patch Changes

- fix devtools visibility issue ([#96](https://github.com/TanStack/pacer/pull/96))

## 0.16.1

### Patch Changes

- Removed auto-uuid key generation for devtools. Now in order for pacer devtools to detect a util, you must define a key option ([#94](https://github.com/TanStack/pacer/pull/94))

## 0.16.0

### Minor Changes

- - feat:Added `AsyncRetryer` class and `asyncRetry` function with exponential/linear/fixed backoff strategies, jitter support, timeout controls (`maxExecutionTime`, `maxTotalExecutionTime`), lifecycle callbacks (`onRetry`, `onSuccess`, `onError`, `onLastError`, `onSettled`, `onAbort`, `onExecutionTimeout`, `onTotalExecutionTimeout`), dynamic options, and built-in retry integration via `asyncRetryerOptions` for all async utilities (`AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) ([#54](https://github.com/TanStack/pacer/pull/54))
  - feat: Added `getAbortSignal()` method to all async utilities (`AsyncRetryer`, `AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) to enable true cancellation of underlying async operations (like fetch requests) when `abort()` is called
  - feat: Added `asyncBatcherOptions`, `asyncDebouncerOptions`, `asyncQueuerOptions`, `asyncRateLimiterOptions`, `asyncRetryerOptions`, `asyncThrottlerOptions`, `debouncerOptions`, `queuerOptions`, `rateLimiterOptions`, `throttlerOptions` utility functions for sharing common options between different pacer utilities
  - fix: Fixed async-throtter trailing edge behavior when long executions were awaited.
  - breaking: standardized `reset`, `cancel` and `abort` API behaviors with consistent naming and behavior across all async utilities. Canceling no longer aborts, new dedicated `abort` method is provided for aborting ongoing executions.

## 0.15.4

### Patch Changes

- bump event client version ([#81](https://github.com/TanStack/pacer/pull/81))

## 0.15.3

### Patch Changes

- update event client version to support react native ([#73](https://github.com/TanStack/pacer/pull/73))

## 0.15.2

### Patch Changes

- fix an issue with react-native and event listeners ([`1a241bf`](https://github.com/TanStack/pacer/commit/1a241bfa25e68044d38f8ae13456dd68d9caff14))

## 0.15.1

### Patch Changes

- fix: queues with priority always pop from front ([#57](https://github.com/TanStack/pacer/pull/57))

## 0.15.0

### Minor Changes

- feat: added pacer devtools ([`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b))

## 0.14.0

### Minor Changes

- fix: remove unneeded structuredClone for state resets ([`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c))

## 0.13.0

### Minor Changes

- breaking: added items/batch/args as params to onSuccess, onSettled, and onExecute callbacks ([`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9))

## 0.12.0

### Minor Changes

- breaking: changed callback signature of `onError` in AsyncDebouncer, AsyncThrottler, AsyncQueuer, AsyncRatelimiter, and AsyncBatcher to include the item that caused the error ([#45](https://github.com/TanStack/pacer/pull/45))
  fix: Fixed Error Handling in Async Debouncer and Throttler by properly resolving and rejecting returned promises from `maybeExecute`

## 0.11.0

### Minor Changes

- fix: lastArgs in `Debouncer` and `AsyncDebouncer` not getting set to undefined after execution ([#43](https://github.com/TanStack/pacer/pull/43))
  fix: `nextExecution` in `Throttler` and `AsyncThrottler` not getting set to undefined after timestamp has passed

## 0.10.0

### Minor Changes

- breaking: Removed `isRunning` state from `Batcher` and `AsyncBatcher` utils, and also removed `start` and `stop` methods ([#40](https://github.com/TanStack/pacer/pull/40))
  breaking: Changed `flush()` method in `AsyncDebouncer`, `AsyncThrottler`, and `AsyncQueuer` to return Promises instead of void
  feat: Added `flushAsBatch` methods to the `Queuer` and `AsyncQueuer` utils
  feat: Added `isExceeded` and `status` state properties to `RateLimiter` and `AsyncRateLimiter` for better rate limit tracking
  feat: Enhanced error handling in `AsyncDebouncer` and `AsyncThrottler` with proper promise rejection support
  feat: Improved timeout management in rate limiters with automatic cleanup of expired execution times

## 0.9.1

### Patch Changes

- Fixed queuer being stuck after flush ([`6b435f5`](https://github.com/TanStack/pacer/commit/6b435f53a628e4103b9a9589b61240896b85cf55))

## 0.9.0

### Minor Changes

- - breaking: Removed most "get" methods that can now be read directly from the state (e.g. `debouncer.getExecutionCount()` -> `debouncer.store.state.executionCount` or `debouncer.state.executionCount` in framework adapters) ([#32](https://github.com/TanStack/pacer/pull/32))
  - breaking: Removed `getOptions` and other option resolver methods such as `getEnabled` and `getWait`
  - feat: Rewrote TanStack Pacer to use TanStack Store for state management
  - feat: Added `flush` methods to all utils to trigger pending executions to execute immediately.
  - feat: Added an `initialState` option to all utils to set the initial state for persistence features
  - feat: Added status state to all utils except rate-limiters for pending, excution, etc. states.
  - feat: Added new AsyncBatcher utility
  - fix: Multiple bug fixes

## 0.8.0

### Minor Changes

- breaking: Renamed `get*Item` instance methods to `peek*Item` instance methods to indicate that they do not pop or process items ([`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5))

## 0.7.0

### Minor Changes

- feat: New `Batcher` Utility to batch process items ([#25](https://github.com/TanStack/pacer/pull/25))
  fix: Fixed `AsyncDebouncer` and `AsyncThrottler` to resolve previous promises on new executions
  breaking: `Queuer` and `AsyncQueuer` have new required `fn` parameter before the `options` parameter to match other utilities and removed `onGetNextItem` option
  breaking: `Queuer` and `AsyncQueuer` now use `execute` method instead instead of `getNextItem`, but both methods are now public
  breaking: For the `AsyncQueuer`, you now add items instead of functions to the AsyncQueuer. The `fn` parameter is now the function to execute for each item.

## 0.6.0

### Minor Changes

- breaking: remove `onError`, `onSuccess`, `onSettled` options from `AsyncQueuer` in favor of options of the same name on the `AsyncQueuer` ([#22](https://github.com/TanStack/pacer/pull/22))
  feat: standardize error handling callbacks on `AsyncQueuer`, `AsyncDebouncer`, `AsyncRateLimiter`, and `AsyncThrottler`
  feat: add `throwOnError` option to `AsyncQueuer`, `AsyncDebouncer`, `AsyncRateLimiter`, and `AsyncThrottler`

## 0.5.0

### Minor Changes

- feat: let enabled, wait, limit, window, and concurrency options support callback variants ([#20](https://github.com/TanStack/pacer/pull/20))
  breaking: set queuer to be started by default

## 0.4.0

### Minor Changes

- Added fixed and sliding windowTypes to rate limiters ([#17](https://github.com/TanStack/pacer/pull/17))
  Added `getIsExecuting` to `AsyncRateLimiter`

## 0.3.0

### Minor Changes

- feat: add queuer expiration feature to `AsyncQueuer` and `Queuer` ([#12](https://github.com/TanStack/pacer/pull/12))
- feat: add return values and types to `AsyncDebouncer`, `AsyncThrottler`, and `AsyncRateLimiter`
- feat: standardize `onSuccess`, `onSettled`, and `onError` in `AsyncDebouncer`, `AsyncThrottler`, and `AsyncRateLimiter`
- feat: replace `getExecutionCount` with `getSuccessCount`, `getErrorCount`, and `getSettleCount` in `AsyncDebouncer`, `AsyncThrottler`, and `AsyncRateLimiter`
- feat: add `getIsPending`, `getIsExecuting`, and `getLastResult` to `AsyncThrottler`
- feat: add `leading` and `trailing` options to `AsyncThrottler`
- breaking: rename `onExecute` to `onSettled` in `AsyncDebouncer`, `AsyncThrottler`, and `AsyncRateLimiter`
- breaking: Set `started` to `true` by default in `AsyncQueuer` and `Queuer`
- breaking: Simplified generics to just use `TFn` instead of `TFn, TArgs` in debouncers, throttlers, and rate limiters
- fix: fixed leading and trailing edge behavior of `Debouncer` and `AsyncDebouncer`
- fix: fixed `getIsPending` to return correct value in `AsyncDebouncer`

## 0.2.0

### Minor Changes

- feat: Add Solid JS Adapter ([`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16))
- rewrote all instance methods on utilities for reading state to use `get*` naming convention
- added `getOptions` methods to all utilities for reading options
- changed rate limiter's `onReject` signature to match other utilities
- added an `onReject` option to the queuer utilities
- added `onExecute`, `onItemsChanged`, `onIsRunningChanged`, and other callbacks to all utilities
- added `getIsPending` methods to debouncer and throttler

## 0.1.0

### Minor Changes

- feat: Initial release ([#2](https://github.com/TanStack/pacer/pull/2))


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [#113](https://github.com/TanStack/pacer/pull/113)
- [`9893832`](https://github.com/TanStack/pacer/commit/98938323f0bc1a6ab87bce72287c6d4a7264cb93)
- [#96](https://github.com/TanStack/pacer/pull/96)
- [#94](https://github.com/TanStack/pacer/pull/94)
- [#54](https://github.com/TanStack/pacer/pull/54)
- [#81](https://github.com/TanStack/pacer/pull/81)
- [#73](https://github.com/TanStack/pacer/pull/73)
- [`1a241bf`](https://github.com/TanStack/pacer/commit/1a241bfa25e68044d38f8ae13456dd68d9caff14)
- [#57](https://github.com/TanStack/pacer/pull/57)
- [`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c)
- [`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9)
- [#45](https://github.com/TanStack/pacer/pull/45)
- [#43](https://github.com/TanStack/pacer/pull/43)
- [#40](https://github.com/TanStack/pacer/pull/40)
- [`6b435f5`](https://github.com/TanStack/pacer/commit/6b435f53a628e4103b9a9589b61240896b85cf55)
- [#32](https://github.com/TanStack/pacer/pull/32)
- [`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5)
- [#25](https://github.com/TanStack/pacer/pull/25)
- [#22](https://github.com/TanStack/pacer/pull/22)
- [#20](https://github.com/TanStack/pacer/pull/20)
- [#17](https://github.com/TanStack/pacer/pull/17)
- [#12](https://github.com/TanStack/pacer/pull/12)
- [`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16)
- [#2](https://github.com/TanStack/pacer/pull/2)

--- packages/preact-pacer-devtools/CHANGELOG.md ---
# @tanstack/preact-pacer-devtools

## 0.5.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

### Patch Changes

- Updated dependencies [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)]:
  - @tanstack/pacer-devtools@1.1.0


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)

--- packages/preact-pacer/CHANGELOG.md ---
# @tanstack/preact-pacer

## 0.18.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

### Patch Changes

- Updated dependencies [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)]:
  - @tanstack/pacer@0.17.0


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)

--- packages/react-pacer-devtools/CHANGELOG.md ---
# @tanstack/react-pacer-devtools

## 0.5.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

### Patch Changes

- Updated dependencies [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)]:
  - @tanstack/pacer-devtools@1.1.0

## 0.4.1

### Patch Changes

- build: migrate to tsdown ([#113](https://github.com/TanStack/pacer/pull/113))

- Updated dependencies [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)]:
  - @tanstack/pacer-devtools@1.0.1

## 0.4.0

### Minor Changes

- - feat:Added `AsyncRetryer` class and `asyncRetry` function with exponential/linear/fixed backoff strategies, jitter support, timeout controls (`maxExecutionTime`, `maxTotalExecutionTime`), lifecycle callbacks (`onRetry`, `onSuccess`, `onError`, `onLastError`, `onSettled`, `onAbort`, `onExecutionTimeout`, `onTotalExecutionTimeout`), dynamic options, and built-in retry integration via `asyncRetryerOptions` for all async utilities (`AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) ([#54](https://github.com/TanStack/pacer/pull/54))
  - feat: Added `getAbortSignal()` method to all async utilities (`AsyncRetryer`, `AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) to enable true cancellation of underlying async operations (like fetch requests) when `abort()` is called
  - feat: Added `asyncBatcherOptions`, `asyncDebouncerOptions`, `asyncQueuerOptions`, `asyncRateLimiterOptions`, `asyncRetryerOptions`, `asyncThrottlerOptions`, `debouncerOptions`, `queuerOptions`, `rateLimiterOptions`, `throttlerOptions` utility functions for sharing common options between different pacer utilities
  - fix: Fixed async-throtter trailing edge behavior when long executions were awaited.
  - breaking: standardized `reset`, `cancel` and `abort` API behaviors with consistent naming and behavior across all async utilities. Canceling no longer aborts, new dedicated `abort` method is provided for aborting ongoing executions.

### Patch Changes

- Updated dependencies [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)]:
  - @tanstack/pacer-devtools@1.0.0

## 0.3.1

### Patch Changes

- update pacer devtools to use devtools-utils to avoid common issues in user projects ([#80](https://github.com/TanStack/pacer/pull/80))

- Updated dependencies [[`4dfd562`](https://github.com/TanStack/pacer/commit/4dfd5628da366d82fc0264ba9d98c02c30a2508d)]:
  - @tanstack/pacer-devtools@0.3.1

## 0.3.0

### Minor Changes

- Added light/dark mode support to Pacer devtools, updated to latest versions of underlying devtools packages and added plugins in favor of users manually defining the panels ([#62](https://github.com/TanStack/pacer/pull/62))

### Patch Changes

- Updated dependencies [[`cbb2855`](https://github.com/TanStack/pacer/commit/cbb285548a49799494c6fb2196aa06b6e181720f)]:
  - @tanstack/pacer-devtools@0.3.0

## 0.2.0

### Minor Changes

- Dropped CJS support, added consistency to styling ([#59](https://github.com/TanStack/pacer/pull/59))

### Patch Changes

- Updated dependencies [[`6922ad1`](https://github.com/TanStack/pacer/commit/6922ad12e56a447f76eb9cbfad63fd054354cd80)]:
  - @tanstack/pacer-devtools@0.2.0

## 0.1.0

### Minor Changes

- feat: added pacer devtools ([`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b))

### Patch Changes

- Updated dependencies [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)]:
  - @tanstack/pacer-devtools@0.1.0


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)
- [#113](https://github.com/TanStack/pacer/pull/113)
- [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)
- [#54](https://github.com/TanStack/pacer/pull/54)
- [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)
- [#80](https://github.com/TanStack/pacer/pull/80)
- [[`4dfd562`](https://github.com/TanStack/pacer/commit/4dfd5628da366d82fc0264ba9d98c02c30a2508d)
- [#62](https://github.com/TanStack/pacer/pull/62)
- [[`cbb2855`](https://github.com/TanStack/pacer/commit/cbb285548a49799494c6fb2196aa06b6e181720f)
- [#59](https://github.com/TanStack/pacer/pull/59)
- [[`6922ad1`](https://github.com/TanStack/pacer/commit/6922ad12e56a447f76eb9cbfad63fd054354cd80)
- [`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)

--- packages/react-pacer/CHANGELOG.md ---
# @tanstack/react-pacer

## 0.18.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

### Patch Changes

- Updated dependencies [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)]:
  - @tanstack/pacer@0.17.0

## 0.17.4

### Patch Changes

- build: migrate to tsdown ([#113](https://github.com/TanStack/pacer/pull/113))

- Updated dependencies [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)]:
  - @tanstack/pacer@0.16.4

## 0.17.3

### Patch Changes

- Updated dependencies [[`9893832`](https://github.com/TanStack/pacer/commit/98938323f0bc1a6ab87bce72287c6d4a7264cb93)]:
  - @tanstack/pacer@0.16.3

## 0.17.2

### Patch Changes

- Updated dependencies [[`f841198`](https://github.com/TanStack/pacer/commit/f8411985a742eb556b26b2f00fad4058df3e2d07)]:
  - @tanstack/pacer@0.16.2

## 0.17.1

### Patch Changes

- Updated dependencies [[`64db505`](https://github.com/TanStack/pacer/commit/64db5057c65837836fed053708e7465987fbcb11)]:
  - @tanstack/pacer@0.16.1

## 0.17.0

### Minor Changes

- feat: Added `PacerProvider` component and related hooks (`usePacerContext`, `useDefaultPacerOptions`) for React applications to set default configurations for all pacer utilities within a component tree ([#54](https://github.com/TanStack/pacer/pull/54))

- - feat:Added `AsyncRetryer` class and `asyncRetry` function with exponential/linear/fixed backoff strategies, jitter support, timeout controls (`maxExecutionTime`, `maxTotalExecutionTime`), lifecycle callbacks (`onRetry`, `onSuccess`, `onError`, `onLastError`, `onSettled`, `onAbort`, `onExecutionTimeout`, `onTotalExecutionTimeout`), dynamic options, and built-in retry integration via `asyncRetryerOptions` for all async utilities (`AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) ([#54](https://github.com/TanStack/pacer/pull/54))
  - feat: Added `getAbortSignal()` method to all async utilities (`AsyncRetryer`, `AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) to enable true cancellation of underlying async operations (like fetch requests) when `abort()` is called
  - feat: Added `asyncBatcherOptions`, `asyncDebouncerOptions`, `asyncQueuerOptions`, `asyncRateLimiterOptions`, `asyncRetryerOptions`, `asyncThrottlerOptions`, `debouncerOptions`, `queuerOptions`, `rateLimiterOptions`, `throttlerOptions` utility functions for sharing common options between different pacer utilities
  - fix: Fixed async-throtter trailing edge behavior when long executions were awaited.
  - breaking: standardized `reset`, `cancel` and `abort` API behaviors with consistent naming and behavior across all async utilities. Canceling no longer aborts, new dedicated `abort` method is provided for aborting ongoing executions.

### Patch Changes

- Updated dependencies [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)]:
  - @tanstack/pacer@0.16.0

## 0.16.4

### Patch Changes

- Updated dependencies [[`129de42`](https://github.com/TanStack/pacer/commit/129de427cb34bcf81d4f1a3c8e26637004aff6b0)]:
  - @tanstack/pacer@0.15.4

## 0.16.3

### Patch Changes

- Updated dependencies [[`8f5d2cb`](https://github.com/TanStack/pacer/commit/8f5d2cb68f0e05c952c1fa8272382d58a6914e28)]:
  - @tanstack/pacer@0.15.3

## 0.16.2

### Patch Changes

- Updated dependencies [[`1a241bf`](https://github.com/TanStack/pacer/commit/1a241bfa25e68044d38f8ae13456dd68d9caff14)]:
  - @tanstack/pacer@0.15.2

## 0.16.1

### Patch Changes

- Updated dependencies [[`9e06f57`](https://github.com/TanStack/pacer/commit/9e06f571ae24342129b1f692d390e6500a675aef)]:
  - @tanstack/pacer@0.15.1

## 0.16.0

### Minor Changes

- feat: added pacer devtools ([`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b))

### Patch Changes

- Updated dependencies [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)]:
  - @tanstack/pacer@0.15.0

## 0.15.0

### Minor Changes

- fix: sync passed function for all utils on every render instead of only on mount to fix closure issues ([`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c))

### Patch Changes

- Updated dependencies [[`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c)]:
  - @tanstack/pacer@0.14.0

## 0.14.0

### Minor Changes

- breaking: added items/batch/args as params to onSuccess, onSettled, and onExecute callbacks ([`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9))

### Patch Changes

- Updated dependencies [[`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9)]:
  - @tanstack/pacer@0.13.0

## 0.13.0

### Minor Changes

- Add `useAsyncBatchedCallback` and `useBatchedCallback`, hooks for batching and debouncing async operations in React ([`10fc5e9`](https://github.com/TanStack/pacer/commit/10fc5e917b55f7be6825af50bb5ecd3ca9c678f7))

## 0.12.0

### Minor Changes

- breaking: changed callback signature of `onError` in AsyncDebouncer, AsyncThrottler, AsyncQueuer, AsyncRatelimiter, and AsyncBatcher to include the item that caused the error ([#45](https://github.com/TanStack/pacer/pull/45))
  fix: Fixed Error Handling in Async Debouncer and Throttler by properly resolving and rejecting returned promises from `maybeExecute`

### Patch Changes

- Updated dependencies [[`0303238`](https://github.com/TanStack/pacer/commit/030323846f34af4683335383d796144f39308106)]:
  - @tanstack/pacer@0.12.0

## 0.11.0

### Minor Changes

- breaking: selectors are required in react and solid adapters in order to read state changes with reactivity ([#43](https://github.com/TanStack/pacer/pull/43))

### Patch Changes

- Updated dependencies [[`7969682`](https://github.com/TanStack/pacer/commit/7969682be3bf8745822baf646d74e17ddb64afac)]:
  - @tanstack/pacer@0.11.0

## 0.10.0

### Minor Changes

- breaking: Removed `isRunning` state from `Batcher` and `AsyncBatcher` utils, and also removed `start` and `stop` methods ([#40](https://github.com/TanStack/pacer/pull/40))
  breaking: Changed `flush()` method in `AsyncDebouncer`, `AsyncThrottler`, and `AsyncQueuer` to return Promises instead of void
  feat: Added `flushAsBatch` methods to the `Queuer` and `AsyncQueuer` utils
  feat: Added `isExceeded` and `status` state properties to `RateLimiter` and `AsyncRateLimiter` for better rate limit tracking
  feat: Enhanced error handling in `AsyncDebouncer` and `AsyncThrottler` with proper promise rejection support
  feat: Improved timeout management in rate limiters with automatic cleanup of expired execution times

### Patch Changes

- Updated dependencies [[`d229d42`](https://github.com/TanStack/pacer/commit/d229d42e95d9da3e8a7f301ce47cf738a9a01f1f)]:
  - @tanstack/pacer@0.10.0

## 0.9.1

### Patch Changes

- Updated dependencies [[`6b435f5`](https://github.com/TanStack/pacer/commit/6b435f53a628e4103b9a9589b61240896b85cf55)]:
  - @tanstack/pacer@0.9.1

## 0.9.0

### Minor Changes

- - breaking: Removed most "get" methods that can now be read directly from the state (e.g. `debouncer.getExecutionCount()` -> `debouncer.store.state.executionCount` or `debouncer.state.executionCount` in framework adapters) ([#32](https://github.com/TanStack/pacer/pull/32))
  - breaking: Removed `getOptions` and other option resolver methods such as `getEnabled` and `getWait`
  - feat: Rewrote TanStack Pacer to use TanStack Store for state management
  - feat: Added `flush` methods to all utils to trigger pending executions to execute immediately.
  - feat: Added an `initialState` option to all utils to set the initial state for persistence features
  - feat: Added status state to all utils except rate-limiters for pending, excution, etc. states.
  - feat: Added new AsyncBatcher utility
  - fix: Multiple bug fixes

### Patch Changes

- Updated dependencies [[`9e7bcb1`](https://github.com/TanStack/pacer/commit/9e7bcb1edf5e53314a6b808b6b9b22ea48df84ff)]:
  - @tanstack/pacer@0.9.0

## 0.8.0

### Minor Changes

- breaking: Renamed `get*Item` instance methods to `peek*Item` instance methods to indicate that they do not pop or process items ([`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5))

### Patch Changes

- Updated dependencies [[`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5)]:
  - @tanstack/pacer@0.8.0

## 0.7.0

### Minor Changes

- feat: New `Batcher` Utility to batch process items ([#25](https://github.com/TanStack/pacer/pull/25))
  fix: Fixed `AsyncDebouncer` and `AsyncThrottler` to resolve previous promises on new executions
  breaking: `Queuer` and `AsyncQueuer` have new required `fn` parameter before the `options` parameter to match other utilities and removed `onGetNextItem` option
  breaking: `Queuer` and `AsyncQueuer` now use `execute` method instead instead of `getNextItem`, but both methods are now public
  breaking: For the `AsyncQueuer`, you now add items instead of functions to the AsyncQueuer. The `fn` parameter is now the function to execute for each item.

### Patch Changes

- Updated dependencies [[`9c03795`](https://github.com/TanStack/pacer/commit/9c037959e90a67ebe3a848fd711bbbd8f3c283cb)]:
  - @tanstack/pacer@0.7.0

## 0.6.0

### Minor Changes

- breaking: remove `onError`, `onSuccess`, `onSettled` options from `AsyncQueuer` in favor of options of the same name on the `AsyncQueuer` ([#22](https://github.com/TanStack/pacer/pull/22))
  feat: standardize error handling callbacks on `AsyncQueuer`, `AsyncDebouncer`, `AsyncRateLimiter`, and `AsyncThrottler`
  feat: add `throwOnError` option to `AsyncQueuer`, `AsyncDebouncer`, `AsyncRateLimiter`, and `AsyncThrottler`

### Patch Changes

- Updated dependencies [[`b3d5247`](https://github.com/TanStack/pacer/commit/b3d52477a387f52b0242d2d753f5f271beb92283)]:
  - @tanstack/pacer@0.6.0

## 0.5.0

### Minor Changes

- feat: let enabled, wait, limit, window, and concurrency options support callback variants ([#20](https://github.com/TanStack/pacer/pull/20))
  breaking: set queuer to be started by default

### Patch Changes

- Updated dependencies [[`a3294e7`](https://github.com/TanStack/pacer/commit/a3294e722915f3a17ea6a1333978994c57568a57)]:
  - @tanstack/pacer@0.5.0

## 0.4.0

### Minor Changes

- Added fixed and sliding windowTypes to rate limiters ([#17](https://github.com/TanStack/pacer/pull/17))
  Added `getIsExecuting` to `AsyncRateLimiter`

### Patch Changes

- Updated dependencies [[`f12ba56`](https://github.com/TanStack/pacer/commit/f12ba561d9eafb6a19a16514f8db1a2f5f6fda82)]:
  - @tanstack/pacer@0.4.0

## 0.3.0

### Minor Changes

- - breaking: renamed `useQueuerState` hook to `useQueuedState` ([#12](https://github.com/TanStack/pacer/pull/12))
  - breaking: changed return signature of `useQueuedState` to include the `addItem` function
  - feat: add `useQueuedValue` hook

### Patch Changes

- Updated dependencies [[`35efeea`](https://github.com/TanStack/pacer/commit/35efeeab76d54a1479bd158db9b804b60e87d89b)]:
  - @tanstack/pacer@0.3.0

## 0.2.0

### Minor Changes

- - updated to use new `@tanstack/pacer` package with all of its breaking changes ([`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16))

### Patch Changes

- Updated dependencies [[`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16)]:
  - @tanstack/pacer@0.2.0

## 0.1.0

### Minor Changes

- feat: Initial release ([#2](https://github.com/TanStack/pacer/pull/2))

### Patch Changes

- Updated dependencies [[`4559434`](https://github.com/TanStack/pacer/commit/4559434d61a06cdfb091e1243d23349c3d909222)]:
  - @tanstack/pacer@0.1.0


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)
- [#113](https://github.com/TanStack/pacer/pull/113)
- [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)
- [[`9893832`](https://github.com/TanStack/pacer/commit/98938323f0bc1a6ab87bce72287c6d4a7264cb93)
- [[`f841198`](https://github.com/TanStack/pacer/commit/f8411985a742eb556b26b2f00fad4058df3e2d07)
- [[`64db505`](https://github.com/TanStack/pacer/commit/64db5057c65837836fed053708e7465987fbcb11)
- [#54](https://github.com/TanStack/pacer/pull/54)
- [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)
- [[`129de42`](https://github.com/TanStack/pacer/commit/129de427cb34bcf81d4f1a3c8e26637004aff6b0)
- [[`8f5d2cb`](https://github.com/TanStack/pacer/commit/8f5d2cb68f0e05c952c1fa8272382d58a6914e28)
- [[`1a241bf`](https://github.com/TanStack/pacer/commit/1a241bfa25e68044d38f8ae13456dd68d9caff14)
- [[`9e06f57`](https://github.com/TanStack/pacer/commit/9e06f571ae24342129b1f692d390e6500a675aef)
- [`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c)
- [[`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c)
- [`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9)
- [[`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9)
- [`10fc5e9`](https://github.com/TanStack/pacer/commit/10fc5e917b55f7be6825af50bb5ecd3ca9c678f7)
- [#45](https://github.com/TanStack/pacer/pull/45)
- [[`0303238`](https://github.com/TanStack/pacer/commit/030323846f34af4683335383d796144f39308106)
- [#43](https://github.com/TanStack/pacer/pull/43)
- [[`7969682`](https://github.com/TanStack/pacer/commit/7969682be3bf8745822baf646d74e17ddb64afac)
- [#40](https://github.com/TanStack/pacer/pull/40)
- [[`d229d42`](https://github.com/TanStack/pacer/commit/d229d42e95d9da3e8a7f301ce47cf738a9a01f1f)
- [[`6b435f5`](https://github.com/TanStack/pacer/commit/6b435f53a628e4103b9a9589b61240896b85cf55)
- [#32](https://github.com/TanStack/pacer/pull/32)
- [[`9e7bcb1`](https://github.com/TanStack/pacer/commit/9e7bcb1edf5e53314a6b808b6b9b22ea48df84ff)
- [`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5)
- [[`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5)
- [#25](https://github.com/TanStack/pacer/pull/25)
- [[`9c03795`](https://github.com/TanStack/pacer/commit/9c037959e90a67ebe3a848fd711bbbd8f3c283cb)
- [#22](https://github.com/TanStack/pacer/pull/22)
- [[`b3d5247`](https://github.com/TanStack/pacer/commit/b3d52477a387f52b0242d2d753f5f271beb92283)
- [#20](https://github.com/TanStack/pacer/pull/20)
- [[`a3294e7`](https://github.com/TanStack/pacer/commit/a3294e722915f3a17ea6a1333978994c57568a57)
- [#17](https://github.com/TanStack/pacer/pull/17)
- [[`f12ba56`](https://github.com/TanStack/pacer/commit/f12ba561d9eafb6a19a16514f8db1a2f5f6fda82)
- [#12](https://github.com/TanStack/pacer/pull/12)
- [[`35efeea`](https://github.com/TanStack/pacer/commit/35efeeab76d54a1479bd158db9b804b60e87d89b)
- [`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16)
- [[`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16)
- [#2](https://github.com/TanStack/pacer/pull/2)
- [[`4559434`](https://github.com/TanStack/pacer/commit/4559434d61a06cdfb091e1243d23349c3d909222)

--- packages/solid-pacer-devtools/CHANGELOG.md ---
# @tanstack/solid-pacer-devtools

## 0.5.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

### Patch Changes

- Updated dependencies [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)]:
  - @tanstack/pacer-devtools@1.1.0

## 0.4.1

### Patch Changes

- build: migrate to tsdown ([#113](https://github.com/TanStack/pacer/pull/113))

- Updated dependencies [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)]:
  - @tanstack/pacer-devtools@1.0.1

## 0.4.0

### Minor Changes

- - feat:Added `AsyncRetryer` class and `asyncRetry` function with exponential/linear/fixed backoff strategies, jitter support, timeout controls (`maxExecutionTime`, `maxTotalExecutionTime`), lifecycle callbacks (`onRetry`, `onSuccess`, `onError`, `onLastError`, `onSettled`, `onAbort`, `onExecutionTimeout`, `onTotalExecutionTimeout`), dynamic options, and built-in retry integration via `asyncRetryerOptions` for all async utilities (`AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) ([#54](https://github.com/TanStack/pacer/pull/54))
  - feat: Added `getAbortSignal()` method to all async utilities (`AsyncRetryer`, `AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) to enable true cancellation of underlying async operations (like fetch requests) when `abort()` is called
  - feat: Added `asyncBatcherOptions`, `asyncDebouncerOptions`, `asyncQueuerOptions`, `asyncRateLimiterOptions`, `asyncRetryerOptions`, `asyncThrottlerOptions`, `debouncerOptions`, `queuerOptions`, `rateLimiterOptions`, `throttlerOptions` utility functions for sharing common options between different pacer utilities
  - fix: Fixed async-throtter trailing edge behavior when long executions were awaited.
  - breaking: standardized `reset`, `cancel` and `abort` API behaviors with consistent naming and behavior across all async utilities. Canceling no longer aborts, new dedicated `abort` method is provided for aborting ongoing executions.

### Patch Changes

- Updated dependencies [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)]:
  - @tanstack/pacer-devtools@1.0.0

## 0.3.1

### Patch Changes

- update pacer devtools to use devtools-utils to avoid common issues in user projects ([#80](https://github.com/TanStack/pacer/pull/80))

- Updated dependencies [[`4dfd562`](https://github.com/TanStack/pacer/commit/4dfd5628da366d82fc0264ba9d98c02c30a2508d)]:
  - @tanstack/pacer-devtools@0.3.1

## 0.3.0

### Minor Changes

- Added light/dark mode support to Pacer devtools, updated to latest versions of underlying devtools packages and added plugins in favor of users manually defining the panels ([#62](https://github.com/TanStack/pacer/pull/62))

### Patch Changes

- Updated dependencies [[`cbb2855`](https://github.com/TanStack/pacer/commit/cbb285548a49799494c6fb2196aa06b6e181720f)]:
  - @tanstack/pacer-devtools@0.3.0

## 0.2.0

### Minor Changes

- Dropped CJS support, added consistency to styling ([#59](https://github.com/TanStack/pacer/pull/59))

### Patch Changes

- Updated dependencies [[`6922ad1`](https://github.com/TanStack/pacer/commit/6922ad12e56a447f76eb9cbfad63fd054354cd80)]:
  - @tanstack/pacer-devtools@0.2.0

## 0.1.0

### Minor Changes

- feat: added pacer devtools ([`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b))

### Patch Changes

- Updated dependencies [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)]:
  - @tanstack/pacer-devtools@0.1.0


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)
- [#113](https://github.com/TanStack/pacer/pull/113)
- [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)
- [#54](https://github.com/TanStack/pacer/pull/54)
- [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)
- [#80](https://github.com/TanStack/pacer/pull/80)
- [[`4dfd562`](https://github.com/TanStack/pacer/commit/4dfd5628da366d82fc0264ba9d98c02c30a2508d)
- [#62](https://github.com/TanStack/pacer/pull/62)
- [[`cbb2855`](https://github.com/TanStack/pacer/commit/cbb285548a49799494c6fb2196aa06b6e181720f)
- [#59](https://github.com/TanStack/pacer/pull/59)
- [[`6922ad1`](https://github.com/TanStack/pacer/commit/6922ad12e56a447f76eb9cbfad63fd054354cd80)
- [`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)

--- packages/solid-pacer/CHANGELOG.md ---
# @tanstack/solid-pacer

## 0.17.0

### Minor Changes

- feat: add preact adapter\ ([#112](https://github.com/TanStack/pacer/pull/112))

### Patch Changes

- Updated dependencies [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)]:
  - @tanstack/pacer@0.17.0

## 0.16.1

### Patch Changes

- build: migrate to tsdown ([#113](https://github.com/TanStack/pacer/pull/113))

- Updated dependencies [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)]:
  - @tanstack/pacer@0.16.4

## 0.16.0

### Minor Changes

- Add new Solid hooks for queue management and provider ([#105](https://github.com/TanStack/pacer/pull/105))
  - Add `createQueuedSignal` - Solid equivalent of `useQueuedState` with signal-based queue item tracking
  - Add `PacerProvider` - Context provider for setting default pacer options in Solid apps

## 0.15.3

### Patch Changes

- Updated dependencies [[`9893832`](https://github.com/TanStack/pacer/commit/98938323f0bc1a6ab87bce72287c6d4a7264cb93)]:
  - @tanstack/pacer@0.16.3

## 0.15.2

### Patch Changes

- Updated dependencies [[`f841198`](https://github.com/TanStack/pacer/commit/f8411985a742eb556b26b2f00fad4058df3e2d07)]:
  - @tanstack/pacer@0.16.2

## 0.15.1

### Patch Changes

- Updated dependencies [[`64db505`](https://github.com/TanStack/pacer/commit/64db5057c65837836fed053708e7465987fbcb11)]:
  - @tanstack/pacer@0.16.1

## 0.15.0

### Minor Changes

- - feat:Added `AsyncRetryer` class and `asyncRetry` function with exponential/linear/fixed backoff strategies, jitter support, timeout controls (`maxExecutionTime`, `maxTotalExecutionTime`), lifecycle callbacks (`onRetry`, `onSuccess`, `onError`, `onLastError`, `onSettled`, `onAbort`, `onExecutionTimeout`, `onTotalExecutionTimeout`), dynamic options, and built-in retry integration via `asyncRetryerOptions` for all async utilities (`AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) ([#54](https://github.com/TanStack/pacer/pull/54))
  - feat: Added `getAbortSignal()` method to all async utilities (`AsyncRetryer`, `AsyncBatcher`, `AsyncDebouncer`, `AsyncQueuer`, `AsyncRateLimiter`, `AsyncThrottler`) to enable true cancellation of underlying async operations (like fetch requests) when `abort()` is called
  - feat: Added `asyncBatcherOptions`, `asyncDebouncerOptions`, `asyncQueuerOptions`, `asyncRateLimiterOptions`, `asyncRetryerOptions`, `asyncThrottlerOptions`, `debouncerOptions`, `queuerOptions`, `rateLimiterOptions`, `throttlerOptions` utility functions for sharing common options between different pacer utilities
  - fix: Fixed async-throtter trailing edge behavior when long executions were awaited.
  - breaking: standardized `reset`, `cancel` and `abort` API behaviors with consistent naming and behavior across all async utilities. Canceling no longer aborts, new dedicated `abort` method is provided for aborting ongoing executions.

### Patch Changes

- Updated dependencies [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)]:
  - @tanstack/pacer@0.16.0

## 0.14.4

### Patch Changes

- Updated dependencies [[`129de42`](https://github.com/TanStack/pacer/commit/129de427cb34bcf81d4f1a3c8e26637004aff6b0)]:
  - @tanstack/pacer@0.15.4

## 0.14.3

### Patch Changes

- Updated dependencies [[`8f5d2cb`](https://github.com/TanStack/pacer/commit/8f5d2cb68f0e05c952c1fa8272382d58a6914e28)]:
  - @tanstack/pacer@0.15.3

## 0.14.2

### Patch Changes

- Updated dependencies [[`1a241bf`](https://github.com/TanStack/pacer/commit/1a241bfa25e68044d38f8ae13456dd68d9caff14)]:
  - @tanstack/pacer@0.15.2

## 0.14.1

### Patch Changes

- Updated dependencies [[`9e06f57`](https://github.com/TanStack/pacer/commit/9e06f571ae24342129b1f692d390e6500a675aef)]:
  - @tanstack/pacer@0.15.1

## 0.14.0

### Minor Changes

- feat: added pacer devtools ([`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b))

### Patch Changes

- Updated dependencies [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)]:
  - @tanstack/pacer@0.15.0

## 0.13.1

### Patch Changes

- Updated dependencies [[`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c)]:
  - @tanstack/pacer@0.14.0

## 0.13.0

### Minor Changes

- breaking: added items/batch/args as params to onSuccess, onSettled, and onExecute callbacks ([`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9))

### Patch Changes

- Updated dependencies [[`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9)]:
  - @tanstack/pacer@0.13.0

## 0.12.0

### Minor Changes

- breaking: changed callback signature of `onError` in AsyncDebouncer, AsyncThrottler, AsyncQueuer, AsyncRatelimiter, and AsyncBatcher to include the item that caused the error ([#45](https://github.com/TanStack/pacer/pull/45))
  fix: Fixed Error Handling in Async Debouncer and Throttler by properly resolving and rejecting returned promises from `maybeExecute`

### Patch Changes

- Updated dependencies [[`0303238`](https://github.com/TanStack/pacer/commit/030323846f34af4683335383d796144f39308106)]:
  - @tanstack/pacer@0.12.0

## 0.11.0

### Minor Changes

- breaking: selectors are required in react and solid adapters in order to read state changes with reactivity ([#43](https://github.com/TanStack/pacer/pull/43))

### Patch Changes

- Updated dependencies [[`7969682`](https://github.com/TanStack/pacer/commit/7969682be3bf8745822baf646d74e17ddb64afac)]:
  - @tanstack/pacer@0.11.0

## 0.10.0

### Minor Changes

- breaking: Removed `isRunning` state from `Batcher` and `AsyncBatcher` utils, and also removed `start` and `stop` methods ([#40](https://github.com/TanStack/pacer/pull/40))
  breaking: Changed `flush()` method in `AsyncDebouncer`, `AsyncThrottler`, and `AsyncQueuer` to return Promises instead of void
  feat: Added `flushAsBatch` methods to the `Queuer` and `AsyncQueuer` utils
  feat: Added `isExceeded` and `status` state properties to `RateLimiter` and `AsyncRateLimiter` for better rate limit tracking
  feat: Enhanced error handling in `AsyncDebouncer` and `AsyncThrottler` with proper promise rejection support
  feat: Improved timeout management in rate limiters with automatic cleanup of expired execution times

### Patch Changes

- Updated dependencies [[`d229d42`](https://github.com/TanStack/pacer/commit/d229d42e95d9da3e8a7f301ce47cf738a9a01f1f)]:
  - @tanstack/pacer@0.10.0

## 0.9.1

### Patch Changes

- Updated dependencies [[`6b435f5`](https://github.com/TanStack/pacer/commit/6b435f53a628e4103b9a9589b61240896b85cf55)]:
  - @tanstack/pacer@0.9.1

## 0.9.0

### Minor Changes

- - breaking: Removed most "get" methods that can now be read directly from the state (e.g. `debouncer.getExecutionCount()` -> `debouncer.store.state.executionCount` or `debouncer.state.executionCount` in framework adapters) ([#32](https://github.com/TanStack/pacer/pull/32))
  - breaking: Removed `getOptions` and other option resolver methods such as `getEnabled` and `getWait`
  - feat: Rewrote TanStack Pacer to use TanStack Store for state management
  - feat: Added `flush` methods to all utils to trigger pending executions to execute immediately.
  - feat: Added an `initialState` option to all utils to set the initial state for persistence features
  - feat: Added status state to all utils except rate-limiters for pending, excution, etc. states.
  - feat: Added new AsyncBatcher utility
  - fix: Multiple bug fixes

### Patch Changes

- Updated dependencies [[`9e7bcb1`](https://github.com/TanStack/pacer/commit/9e7bcb1edf5e53314a6b808b6b9b22ea48df84ff)]:
  - @tanstack/pacer@0.9.0

## 0.8.0

### Minor Changes

- breaking: Renamed `get*Item` instance methods to `peek*Item` instance methods to indicate that they do not pop or process items ([`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5))

### Patch Changes

- Updated dependencies [[`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5)]:
  - @tanstack/pacer@0.8.0

## 0.7.0

### Minor Changes

- feat: New `Batcher` Utility to batch process items ([#25](https://github.com/TanStack/pacer/pull/25))
  fix: Fixed `AsyncDebouncer` and `AsyncThrottler` to resolve previous promises on new executions
  breaking: `Queuer` and `AsyncQueuer` have new required `fn` parameter before the `options` parameter to match other utilities and removed `onGetNextItem` option
  breaking: `Queuer` and `AsyncQueuer` now use `execute` method instead instead of `getNextItem`, but both methods are now public
  breaking: For the `AsyncQueuer`, you now add items instead of functions to the AsyncQueuer. The `fn` parameter is now the function to execute for each item.

### Patch Changes

- Updated dependencies [[`9c03795`](https://github.com/TanStack/pacer/commit/9c037959e90a67ebe3a848fd711bbbd8f3c283cb)]:
  - @tanstack/pacer@0.7.0

## 0.6.0

### Minor Changes

- breaking: remove `onError`, `onSuccess`, `onSettled` options from `AsyncQueuer` in favor of options of the same name on the `AsyncQueuer` ([#22](https://github.com/TanStack/pacer/pull/22))
  feat: standardize error handling callbacks on `AsyncQueuer`, `AsyncDebouncer`, `AsyncRateLimiter`, and `AsyncThrottler`
  feat: add `throwOnError` option to `AsyncQueuer`, `AsyncDebouncer`, `AsyncRateLimiter`, and `AsyncThrottler`

### Patch Changes

- Updated dependencies [[`b3d5247`](https://github.com/TanStack/pacer/commit/b3d52477a387f52b0242d2d753f5f271beb92283)]:
  - @tanstack/pacer@0.6.0

## 0.5.0

### Minor Changes

- feat: let enabled, wait, limit, window, and concurrency options support callback variants ([#20](https://github.com/TanStack/pacer/pull/20))
  breaking: set queuer to be started by default

### Patch Changes

- Updated dependencies [[`a3294e7`](https://github.com/TanStack/pacer/commit/a3294e722915f3a17ea6a1333978994c57568a57)]:
  - @tanstack/pacer@0.5.0

## 0.4.0

### Minor Changes

- Added fixed and sliding windowTypes to rate limiters ([#17](https://github.com/TanStack/pacer/pull/17))
  Added `getIsExecuting` to `AsyncRateLimiter`

### Patch Changes

- Updated dependencies [[`f12ba56`](https://github.com/TanStack/pacer/commit/f12ba561d9eafb6a19a16514f8db1a2f5f6fda82)]:
  - @tanstack/pacer@0.4.0

## 0.3.0

### Minor Changes

- - breaking: renamed `createQueuerState` hook to `createQueuedState` ([#12](https://github.com/TanStack/pacer/pull/12))
  - breaking: changed return signature of `createQueuedState` to include the `addItem` function
  - feat: add `createQueuedValue` hook

### Patch Changes

- Updated dependencies [[`35efeea`](https://github.com/TanStack/pacer/commit/35efeeab76d54a1479bd158db9b804b60e87d89b)]:
  - @tanstack/pacer@0.3.0

## 0.2.0

### Minor Changes

- - feat: Add Solid JS Adapter ([`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16))

### Patch Changes

- Updated dependencies [[`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16)]:
  - @tanstack/pacer@0.2.0

## 0.1.0

### Minor Changes

- feat: Initial release ([#2](https://github.com/TanStack/pacer/pull/2))

### Patch Changes

- Updated dependencies [[`4559434`](https://github.com/TanStack/pacer/commit/4559434d61a06cdfb091e1243d23349c3d909222)]:
  - @tanstack/pacer@0.1.0


## Links discovered
- [#112](https://github.com/TanStack/pacer/pull/112)
- [[`2906cd3`](https://github.com/TanStack/pacer/commit/2906cd3ca1a4bc54460cf8558dbff2d8f4089f6c)
- [#113](https://github.com/TanStack/pacer/pull/113)
- [[`adc3193`](https://github.com/TanStack/pacer/commit/adc3193e2a8d15de29b89444f775e8e1b0302e3e)
- [#105](https://github.com/TanStack/pacer/pull/105)
- [[`9893832`](https://github.com/TanStack/pacer/commit/98938323f0bc1a6ab87bce72287c6d4a7264cb93)
- [[`f841198`](https://github.com/TanStack/pacer/commit/f8411985a742eb556b26b2f00fad4058df3e2d07)
- [[`64db505`](https://github.com/TanStack/pacer/commit/64db5057c65837836fed053708e7465987fbcb11)
- [#54](https://github.com/TanStack/pacer/pull/54)
- [[`3124ea3`](https://github.com/TanStack/pacer/commit/3124ea34cab13dd69f286a6836c585aaf6f083c4)
- [[`129de42`](https://github.com/TanStack/pacer/commit/129de427cb34bcf81d4f1a3c8e26637004aff6b0)
- [[`8f5d2cb`](https://github.com/TanStack/pacer/commit/8f5d2cb68f0e05c952c1fa8272382d58a6914e28)
- [[`1a241bf`](https://github.com/TanStack/pacer/commit/1a241bfa25e68044d38f8ae13456dd68d9caff14)
- [[`9e06f57`](https://github.com/TanStack/pacer/commit/9e06f571ae24342129b1f692d390e6500a675aef)
- [`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [[`3206b5f`](https://github.com/TanStack/pacer/commit/3206b5f8167d13bc1c642c53574bb65ea126d24b)
- [[`98ae22c`](https://github.com/TanStack/pacer/commit/98ae22c5836aca9ff6a404770d7f210e686e098c)
- [`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9)
- [[`e92923b`](https://github.com/TanStack/pacer/commit/e92923b764c6eb42b76bd5edaaac446c4f6a13f9)
- [#45](https://github.com/TanStack/pacer/pull/45)
- [[`0303238`](https://github.com/TanStack/pacer/commit/030323846f34af4683335383d796144f39308106)
- [#43](https://github.com/TanStack/pacer/pull/43)
- [[`7969682`](https://github.com/TanStack/pacer/commit/7969682be3bf8745822baf646d74e17ddb64afac)
- [#40](https://github.com/TanStack/pacer/pull/40)
- [[`d229d42`](https://github.com/TanStack/pacer/commit/d229d42e95d9da3e8a7f301ce47cf738a9a01f1f)
- [[`6b435f5`](https://github.com/TanStack/pacer/commit/6b435f53a628e4103b9a9589b61240896b85cf55)
- [#32](https://github.com/TanStack/pacer/pull/32)
- [[`9e7bcb1`](https://github.com/TanStack/pacer/commit/9e7bcb1edf5e53314a6b808b6b9b22ea48df84ff)
- [`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5)
- [[`1599c97`](https://github.com/TanStack/pacer/commit/1599c9785f7496648a2b44274b839c7f784ce7f5)
- [#25](https://github.com/TanStack/pacer/pull/25)
- [[`9c03795`](https://github.com/TanStack/pacer/commit/9c037959e90a67ebe3a848fd711bbbd8f3c283cb)
- [#22](https://github.com/TanStack/pacer/pull/22)
- [[`b3d5247`](https://github.com/TanStack/pacer/commit/b3d52477a387f52b0242d2d753f5f271beb92283)
- [#20](https://github.com/TanStack/pacer/pull/20)
- [[`a3294e7`](https://github.com/TanStack/pacer/commit/a3294e722915f3a17ea6a1333978994c57568a57)
- [#17](https://github.com/TanStack/pacer/pull/17)
- [[`f12ba56`](https://github.com/TanStack/pacer/commit/f12ba561d9eafb6a19a16514f8db1a2f5f6fda82)
- [#12](https://github.com/TanStack/pacer/pull/12)
- [[`35efeea`](https://github.com/TanStack/pacer/commit/35efeeab76d54a1479bd158db9b804b60e87d89b)
- [`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16)
- [[`19cee99`](https://github.com/TanStack/pacer/commit/19cee995d79bc16077c9a28fc5f6ab251d626e16)
- [#2](https://github.com/TanStack/pacer/pull/2)
- [[`4559434`](https://github.com/TanStack/pacer/commit/4559434d61a06cdfb091e1243d23349c3d909222)

--- .github/pull_request_template.md ---
## 🎯 Changes

<!-- What changes are made in this PR? Describe the change and its motivation. -->

## ✅ Checklist

- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/pacer/blob/main/CONTRIBUTING.md).
- [ ] I have tested this code locally with `pnpm run test:pr`.

## 🚀 Release Impact

- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
- [ ] This change is docs/CI/dev-only (no release).


## Links discovered
- [Contributing guide](https://github.com/TanStack/pacer/blob/main/CONTRIBUTING.md)
- [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)

--- CODE_OF_CONDUCT.md ---
---
title: Code of Conduct
id: code-of-conduct
---

# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
  advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
  address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at TANNERLINSLEY@GMAIL.COM. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq


--- README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- eslint.config.js ---
// @ts-check

// @ts-ignore Needed due to moduleResolution Node vs Bundler
import { tanstackConfig } from '@tanstack/eslint-config'
import unusedImports from 'eslint-plugin-unused-imports'

/** @type {import('eslint').Linter.Config[]} */
export default [
  ...tanstackConfig,
  {
    name: 'tanstack/temp',
    plugins: {
      'unused-imports': unusedImports,
    },
    rules: {
      'no-case-declarations': 'off',
      'no-shadow': 'off',
      'unused-imports/no-unused-imports': 'warn',
      'pnpm/enforce-catalog': 'off',
      'pnpm/json-enforce-catalog': 'off',
    },
  },
]


--- prettier.config.js ---
// @ts-check

/** @type {import('prettier').Config} */
const config = {
  semi: false,
  singleQuote: true,
  trailingComma: 'all',
  plugins: ['prettier-plugin-svelte'],
  overrides: [{ files: '*.svelte', options: { parser: 'svelte' } }],
}

export default config


--- scripts/verify-links.ts ---
import { existsSync, readFileSync, statSync } from 'node:fs'
import { extname, resolve } from 'node:path'
import { glob } from 'tinyglobby'
// @ts-ignore Could not find a declaration file for module 'markdown-link-extractor'.
import markdownLinkExtractor from 'markdown-link-extractor'

const errors: Array<{
  file: string
  link: string
  resolvedPath: string
  reason: string
}> = []

function isRelativeLink(link: string) {
  return (
    !link.startsWith('/') &&
    !link.startsWith('http://') &&
    !link.startsWith('https://') &&
    !link.startsWith('//') &&
    !link.startsWith('#') &&
    !link.startsWith('mailto:')
  )
}

/** Remove any trailing .md */
function stripExtension(p: string): string {
  return p.replace(`${extname(p)}`, '')
}

function relativeLinkExists(link: string, file: string): boolean {
  // Remove hash if present
  const linkWithoutHash = link.split('#')[0]
  // If the link is empty after removing hash, it's not a file
  if (!linkWithoutHash) return false

  // Strip the file/link extensions
  const filePath = stripExtension(file)
  const linkPath = stripExtension(linkWithoutHash)

  // Resolve the path relative to the markdown file's directory
  // Nav up a level to simulate how links are resolved on the web
  let absPath = resolve(filePath, '..', linkPath)

  // Ensure the resolved path is within /docs
  const docsRoot = resolve('docs')
  if (!absPath.startsWith(docsRoot)) {
    errors.push({
      link,
      file,
      resolvedPath: absPath,
      reason: 'Path outside /docs',
    })
    return false
  }

  // Check if this is an example path
  const isExample = absPath.includes('/examples/')

  let exists = false

  if (isExample) {
    // Transform /docs/framework/{framework}/examples/ to /examples/{framework}/
    absPath = absPath.replace(
      /\/docs\/framework\/([^/]+)\/examples\//,
      '/examples/$1/',
    )
    // For examples, we want to check if the directory exists
    exists = existsSync(absPath) && statSync(absPath).isDirectory()
  } else {
    // For non-examples, we want to check if the .md file exists
    if (!absPath.endsWith('.md')) {
      absPath = `${absPath}.md`
    }
    exists = existsSync(absPath)
  }

  if (!exists) {
    errors.push({
      link,
      file,
      resolvedPath: absPath,
      reason: 'Not found',
    })
  }
  return exists
}

async function verifyMarkdownLinks() {
  // Find all markdown files in docs directory
  const markdownFiles = await glob('docs/**/*.md', {
    ignore: ['**/node_modules/**'],
  })

  console.log(`Found ${markdownFiles.length} markdown files\n`)

  // Process each file
  for (const file of markdownFiles) {
    const content = readFileSync(file, 'utf-8')
    const links: Array<string> = markdownLinkExtractor(content)

    const relativeLinks = links.filter((link: string) => {
      return isRelativeLink(link)
    })

    if (relativeLinks.length > 0) {
      relativeLinks.forEach((link) => {
        relativeLinkExists(link, file)
      })
    }
  }

  if (errors.length > 0) {
    console.log(`\n❌ Found ${errors.length} broken links:`)
    errors.forEach((err) => {
      console.log(
        `${err.file}\n  link:      ${err.link}\n  resolved:  ${err.resolvedPath}\n  why:       ${err.reason}\n`,
      )
    })
    process.exit(1)
  } else {
    console.log('\n✅ No broken links found!')
  }
}

verifyMarkdownLinks().catch(console.error)


--- vitest.workspace.js ---
import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    projects: [
      './packages/pacer/vite.config.ts',
      './packages/pacer-lite/vite.config.ts',
      './packages/preact-pacer/vitest.config.ts',
      './packages/preact-pacer-devtools/vitest.config.ts',
      './packages/react-pacer/vite.config.ts',
      './packages/react-pacer-devtools/vite.config.ts',
      './packages/solid-pacer/vite.config.ts',
      './packages/solid-pacer-devtools/vite.config.ts',
    ],
  },
})


--- packages/pacer-devtools/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/pacer-devtools/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/pacer-lite/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/pacer-lite/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/pacer/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/pacer/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/preact-pacer-devtools/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/preact-pacer-devtools/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/preact-pacer/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/preact-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/preact-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Preact Pacer - Coming soon! (After React Pacer is more fleshed out)
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/preact-pacer/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/preact-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/preact-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/react-pacer-devtools/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/react-pacer-devtools/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/react-pacer/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/react-pacer/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/solid-pacer-devtools/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/solid-pacer-devtools/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/solid-pacer/README.md ---
<div align="center">
  <img src="./media/header_pacer.png" >
</div>

<br />

<div align="center">
	<a href="https://www.npmjs.com/package/@tanstack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />
	</a>
- <a href="https://github.com/TanStack/pacer" target="\_parent">
	  <img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />
	</a>
	<a href="https://bundlephobia.com/result?p=@tanstack/react-pacer@latest" target="\_parent">
  <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />
</a>
</div>

<div align="center">
<a href="#badge">
  <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
	<a href="#badge">
		<img src="https://img.shields.io/github/v/release/tanstack/pacer" alt="Release"/>
	</a>
	<a href="https://twitter.com/tan_stack">
		<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
	</a>
</div>

<div align="center">
  
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
</div>

# TanStack Pacer

A lightweight timing and scheduling library for debouncing, throttling, rate limiting, queuing, and batching.

> [!NOTE]
> TanStack Pacer is currently mostly a client-side only library, but it is being designed to be able to potentially be used on the server-side as well.

- **Debouncing**
  - Delay execution until after a period of inactivity for when you only care about the last execution in a sequence.
  - Synchronous or Asynchronous Debounce utilities with promise support and error handling
  - Control of leading, trailing, and enabled options
- **Throttling**
  - Smoothly limit the rate at which a function can fire
  - Synchronous or Asynchronous Throttle utilities with promise support and error handling
  - Control of leading, trailing, and enabled options.
- **Rate Limiting**
  - Limit the rate at which a function can fire over a period of time
  - Synchronous or Asynchronous Rate Limiting utilities with promise support and error handling
  - Fixed or Sliding Window variations of Rate Limiting
- **Queuing**
  - Queue functions to be executed in a specific order
  - Choose from FIFO, LIFO, and Priority queue implementations
  - Control processing speed with configurable wait times or concurrency limits
  - Manage queue execution with start/stop capabilities
  - Expire items from the queue after a configurable duration
- **Batching**
  - Chunk up multiple operations into larger batches to reduce total back-and-forth operations
  - Batch by time period, batch size, whichever comes first, or a custom condition to trigger batch executions
- **Async or Sync Variations**
  - Choose between synchronous and asynchronous versions of each utility
  - Optional error, success, and settled handling for async variations
  - Retry and Abort support for async variations
- **State Management**
  - Uses TanStack Store under the hood for state management with fine-grained reactivity
  - Easily integrate with your own state management library of choice
  - Persist state to local or session storage for some utilities like rate limiting and queuing
- **Convenient Hooks**
  - Reduce boilerplate code with pre-built hooks like `useDebouncedCallback`, `useThrottledValue`, and `useQueuedState`, and more.
  - Multiple layers of abstraction to choose from depending on your use case.
  - Works with each framework's default state management solutions, or with whatever custom state management library that you prefer.
- **Type Safety**
  - Full type safety with TypeScript that makes sure that your functions will always be called with the correct arguments
  - Generics for flexible and reusable utilities
- **Framework Adapters**
  - React, Solid, and more
- **Tree Shaking**
  - We, of course, get tree-shaking right for your applications by default, but we also provide extra deep imports for each utility, making it easier to embed these utilities into your libraries without increasing the bundle-phobia reports of your library.

### <a href="https://tanstack.com/pacer">Read the docs →</b></a>

<br />

> [!NOTE]
> You may know **TanSack Pacer** by our adapter names, too!
>
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
> - Angular Pacer - needs a contributor!
> - Svelte Pacer - needs a contributor!
> - Vue Pacer - needs a contributor!

## Get Involved

- We welcome issues and pull requests!
- Participate in [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions

## Partners

<table align="center">
  <tr>
    <td>
      <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
          <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.cloudflare.com?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
          <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
        </picture>
      </a>
    </td>
    <td>
      <a href="https://www.unkey.com/?utm_source=tanstack">
        <picture>
          <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" />
          <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" />
          <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/>
        </picture>
      </a>
    </td>
  </tr>
</table>

<div align="center">
<img src="./media/partner_logo.svg" alt="Pacer & you?" height="65">
<p>
We're looking for TanStack Pacer Partners to join our mission! Partner with us to push the boundaries of TanStack Pacer and build amazing things together.
</p>
<a href="mailto:partners@tanstack.com?subject=TanStack Pacer Partnership"><b>LET'S CHAT</b></a>
</div>

</div>

## Explore the TanStack Ecosystem

- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering

… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>

<!-- USE THE FORCE LUKE -->


## Links discovered
- [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
- [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
- [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
- [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
- [GitHub discussions](https://github.com/TanStack/pacer/discussions)
- [Discord](https://discord.com/invite/WrRKjPJ)
- [CONTRIBUTING.md](https://github.com/tanstack/pacer/blob/main/packages/solid-pacer/CONTRIBUTING.md)
- [<img alt="" src="https://img.shields.io/npm/dm/@tanstack/pacer.svg" alt="npm downloads" />](https://www.npmjs.com/package/@tanstack/pacer)
- [<img alt="" src="https://img.shields.io/github/stars/TanStack/pacer.svg?style=social&label=Star" alt="GitHub stars" />](https://github.com/TanStack/pacer)
- [<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-pacer@latest" alt="Bundle size" />](https://bundlephobia.com/result?p=@tanstack/react-pacer@latest)
- [<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>](https://twitter.com/tan_stack)
- [Read the docs →</b>](https://tanstack.com/pacer)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> </picture>](https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> </picture>](https://www.cloudflare.com?utm_source=tanstack)
- [<picture> <source media="(prefers-color-scheme: dark)" srcset="./media/unkey_dark.svg" height="60" /> <source media="(prefers-color-scheme: light)" srcset="./media/unkey_logo.svg" height="60" /> <img src="./media/unkey_logo.svg" height="60" alt="Unkey"/> </picture>](https://www.unkey.com/?utm_source=tanstack)
- [<b>TanStack Config</b>](https://github.com/tanstack/config)
- [<b>TanStack DB</b>](https://github.com/tanstack/db)
- [<b>TanStack DevTools</b>](https://github.com/tanstack/devtools)
- [<b>TanStack Form</b>](https://github.com/tanstack/form)
- [<b>TanStack Query</b>](https://github.com/tanstack/query)
- [<b>TanStack Ranger</b>](https://github.com/tanstack/ranger)
- [<b>TanStack Router</b>](https://github.com/tanstack/router)
- [<b>TanStack Start</b>](https://github.com/tanstack/router)
- [<b>TanStack Store</b>](https://github.com/tanstack/store)
- [<b>TanStack Table</b>](https://github.com/tanstack/table)
- [<b>TanStack Virtual</b>](https://github.com/tanstack/virtual)
- [<b>TanStack.com »</b>](https://tanstack.com)

--- packages/pacer-devtools/eslint.config.js ---
// @ts-check

import rootConfig from '../../eslint.config.js'

/** @type {import('eslint').Linter.Config[]} */
export default [
  ...rootConfig,
  {
    rules: {},
  },
]
