Skip to content

combineRateLimits

function combineRateLimits(a, b): RateLimit;

Defined in: tanstack/core/rate-limit.ts:81

When several updates coincide in the same tick, the strongest limit wins: the longest delay, and debounce dominates throttle (it waits for settling). The store uses this to merge batched updates; adapter authors can reuse it.

Parameter Type
a RateLimit
b RateLimit

RateLimit

import { combineRateLimits, debounce, throttle } from "@xtandard/lib/tanstack";
combineRateLimits(throttle(50), throttle(120)); // → { method: "throttle", timeMs: 120 }
combineRateLimits(throttle(50), debounce(10)); // → { method: "debounce", timeMs: 50 }