TanStack Pacer is a lightweight, type-safe library for controlling function execution timing through debouncing, throttling, rate limiting, queuing, and batching. It provides framework-agnostic core classes with dedicated React hooks at multiple abstraction levels (instance, callback, state, value).
When to use: Debouncing search input, throttling scroll/resize handlers, enforcing API rate limits, queuing async tasks with concurrency control, batching multiple operations into single requests.
When NOT to use: Simple one-off delays (use setTimeout), server-side rate limiting at the infrastructure level (use middleware/API gateway), complex job scheduling (use a task queue like BullMQ).
TanStack Pacer لتحديد المعدل، والاختناق، والارتداد، وقائمة الانتظار غير المتزامنة. يُستخدم عند التحكم في تكرار التنفيذ، أو إدارة حدود معدل واجهة برمجة التطبيقات (API)، أو رفض إدخال المستخدم، أو وضع المهام غير المتزامنة في قائمة الانتظار. يستخدم لضبط السرعة، والخانق، والارتداد، والحد الأقصى للمعدل، وقائمة الانتظار، والخانق غير المتزامن، والحد من المعدل. المصدر: oakoss/agent-skills.