tanstack-pacer

Control JavaScript and React callback execution with debounce, throttle, and rate limiting.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/TaherMustansir1929/zainy-water-v3 --skill tanstack-pacer-tahermustansir1929
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-pacer
Source: https://github.com/TaherMustansir1929/zainy-water-v3/tree/main/.agents/skills/tanstack-pacer
Command: npx skills add https://github.com/TaherMustansir1929/zainy-water-v3 --skill tanstack-pacer-tahermustansir1929

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TanStack Pacer solves unpredictable and wasteful function executions by providing precise control over when and how functions run, reducing redundant calls and protecting APIs from overload.

Core Features & Use Cases

  • Debouncing & Throttling: Prevent excessive invocations for inputs and event handlers, such as debouncing search inputs or throttling scroll handlers.
  • Rate Limiting, Queuing & Batching: Enforce call limits, serialize uploads or tasks, and group events for efficient network usage; ideal for API protection, file uploads, and analytics batching.
  • APIs & Integrations: Offers class-based APIs, factory helpers, async variants, and React hooks to integrate with both framework-agnostic and React applications.

Quick Start

Use tanstack-pacer to debounce a search input with a 300ms wait and return the debounced callback to use in your UI.

Frequently Asked Questions about tanstack-pacer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debounce search inputs in React to reduce redundant API calls?

To debounce search inputs in React, you can use a React hook with a configurable wait option to delay function execution until typing pauses. This reduces redundant invocations and protects your API from overload.

What is the best way to throttle scroll handlers in JavaScript?

Throttling scroll handlers in JavaScript is best handled using a throttle function that enforces a maximum execution rate. You can configure leading and trailing options to control exactly when the function fires during the scroll event.

Can I rate-limit API calls and queue file uploads in both client and server JavaScript?

Yes, you can rate-limit API calls and queue file uploads in both client and server JavaScript. The tool provides async variants and queuing mechanisms with configurable concurrency and limit/window settings to serialize tasks.

Does this rate-limiter library support batching events for analytics?

Yes, the rate-limiter library supports batching events for analytics by grouping function calls together. This approach enforces call limits and ensures efficient network usage for analytics payloads.

How do I configure maxWait and flush controls for debounced callbacks?

You can configure maxWait and flush controls for debounced callbacks using the provided class APIs or factory functions. These options ensure delayed functions execute after a maximum wait time and allow manual clearing of pending calls.