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 |
Minimal setup
Use a Vue 3.5+ project with Vue SFC compilation configured (see Vite+ integration).
vp install @vizejs/composable
Import the entry directly. Call lifecycle-bound utilities inside <script setup> so cleanup follows the component scope; consult the runtime contract for this entry's SSR and hydration behavior.
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. |