Mixins / foldkit-mixins/testing

TrackedFrames

interface · packages/mixins/src/testing.ts:266

interface TrackedFrames {
  readonly hold: () => void
  readonly release: () => void
  readonly settle: (...barriers: ReadonlyArray<Settles>) => Promise<void>
  readonly dispose: () => void
}

The page's animation frames, tracked: held, released, and waited for.

Members

TrackedFrames.hold

property · packages/mixins/src/testing.ts:268

readonly hold: () => void

Holds every frame asked for from now until release: nothing is drawn meanwhile.

TrackedFrames.release

property · packages/mixins/src/testing.ts:270

readonly release: () => void

Runs the held frames, and lets those after run as they are asked for.

TrackedFrames.settle

property · packages/mixins/src/testing.ts:281

readonly settle: (...barriers: ReadonlyArray<Settles>) => Promise<void>

Resolves once nothing is left to draw: every frame asked for has run, and a turn of the event loop after the last asked for no other. Each of barriers settles first, and the two are waited for again until both are quiet in one round, since a frame can lead to a dispatch and a dispatch to a frame. Rejects while frames are held, and after 50 rounds of frames that keep coming. It knows only frames asked for: a runtime still starting has asked for none, so wait for its first drawing, and for I/O a Command started, before settling what follows.

TrackedFrames.dispose

property · packages/mixins/src/testing.ts:283

readonly dispose: () => void

Puts back the frame functions it replaced.