variable / @typed/template/Render

CurrentRenderQueue

A service that manages the queue of DOM updates.

It ensures that DOM updates are batched and executed efficiently, often coordinating with browser painting cycles (e.g., via requestAnimationFrame).

Package version
1.0.0-beta.13
Category
Render scheduling
Since
1.0.0

Import

import { CurrentRenderQueue } from "@typed/template/Render";

Signatures

export declare const CurrentRenderQueue: Context.Reference<RQ.RenderQueue>;

Why

Scheduling policy is separate from template semantics. Scalar parts retain direct DOM targets while the queue decides when their already-local updates execute.

Ownership and lifetime

The default queue is created lazily for the current Effect context. Queue callbacks are disposable and render Scopes cancel pending work on cleanup.

Examples

import { CurrentRenderQueue } from "@typed/template/Render"
import { MixedRenderQueue } from "@typed/template/RenderQueue"
import { Layer } from "effect"

// Use a custom render queue
const customQueue = new MixedRenderQueue()
const queueLayer = Layer.succeed(CurrentRenderQueue, customQueue)

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source