DomClock

The DOM's Clock: core's Clock and its Refresh frame source over the browser's requestAnimationFrame, as one Layer that needs nothing. DomLive provides it.

import * as DomClock from "@wardic/dom/DomClock"

const now = Effect.map(Clock.Clock, (clock) => clock.now()).pipe(Effect.provide(DomClock.layer))

Variables

layer

const layer: Layer.Layer<Clock.Clock | RefreshFrameSource.RefreshFrameSource>;

Core's Clock and the Environment's RefreshFrameSource, from one requestAnimationFrame, needing nothing: the frame loop runs in the Layer's own scope. It reads requestAnimationFrame when the Layer is built, not when @wardic/dom is imported, so a test that stubs it first drives this Clock. Building it on a server fails, with an error that says it's client-only.