Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/xstate/src/SimulatedClock.ts>SimulatedClock

State machines and statecharts for the modern web.
Go to Latest
class SimulatedClock
implements SimulatedClock
import { SimulatedClock } from "https://deno.land/x/xstate@xstate@5.0.0-beta.23/src/SimulatedClock.ts";

Properties

private
_id: number
private
_now: number
private
timeouts: Map<number, SimulatedTimeout>

Methods

private
flushTimeouts()
private
getId()
clearTimeout(id: number)
increment(ms: number): void
now()
set(time: number)
setTimeout(fn: (...args: any[]) => void, timeout: number)
interface SimulatedClock
implements Clock
import { type SimulatedClock } from "https://deno.land/x/xstate@xstate@5.0.0-beta.23/src/SimulatedClock.ts";

Methods

start(speed: number): void
increment(ms: number): void
set(ms: number): void