Vize

timeout-scheduler

Single-shot timer host used by the debounced and throttled state utilities. Implement this interface to integrate a deterministic test clock, a native runtime timer, or an application-owned scheduler. Handles are opaque: the utilities only hand them back to TimeoutScheduler.clearTimeout. This module declares types only and contributes no runtime code.

Package @vizejs/composable/timeout-scheduler
Own the source vize lib pull composable:timeout-scheduler
Runtime exports —
Gzip budget 256 B

Usage

import type { TimeoutScheduler } from "@vizejs/composable/timeout-scheduler";

Types

TimeoutScheduler

Single-shot timer host used by the debounced and throttled state utilities. Implement this interface to integrate a deterministic test clock, a native runtime timer, or an application-owned scheduler. Handles are opaque: the utilities only hand them back to TimeoutScheduler.clearTimeout. This module declares types only and contributes no runtime code.

Member Type Description
setTimeout (callback: () => void, delayMs: number) => unknown Starts a single-shot callback and returns its opaque cancellation handle.
clearTimeout (handle: unknown) => void Cancels a handle previously returned by TimeoutScheduler.setTimeout.