katanakit-js / TimeoutProvider
Type Alias: TimeoutProvider<TTimerId>
ts
type TimeoutProvider<TTimerId> = {
clearInterval: (intervalId) => void;
clearTimeout: (timeoutId) => void;
setInterval: (callback, delay) => TTimerId;
setTimeout: (callback, delay) => TTimerId;
};Defined in: node_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts:29
Backend for timer functions.
Timers are performance-sensitive: short-lived timers (delays under a few seconds) tend to be latency-sensitive, while long-lived ones may benefit more from coalescing — batching timers with similar deadlines together — which the default provider (backed by the platform's global setTimeout/setInterval) does not do. A custom provider can implement coalescing, and can also support delays longer than the ~24-day maximum of the global setTimeout.
Type Parameters
| Type Parameter | Default type |
|---|---|
TTimerId extends ManagedTimerId | ManagedTimerId |