Skip to content
0

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 ParameterDefault type
TTimerId extends ManagedTimerIdManagedTimerId

Properties ​

PropertyModifierTypeDefined in
clearIntervalreadonly(intervalId) => voidnode_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts:33
clearTimeoutreadonly(timeoutId) => voidnode_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts:31
setIntervalreadonly(callback, delay) => TTimerIdnode_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts:32
setTimeoutreadonly(callback, delay) => TTimerIdnode_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts:30

Released under the MIT License.