type-alias / @typed/template/HydrateContext

HydrateContext

Advanced renderer state describing the current hydration range.

Package version
1.0.0-beta.7
Category
Hydration context
Since
1.0.0
Stability
internal-but-published

Import

import { HydrateContext } from "@typed/template/HydrateContext";

Signatures

export type HydrateContext = {
    readonly where: HydrationNode;
    readonly manyKey?: string;
};
export declare const HydrateContext: Context.Service<HydrateContext, HydrateContext>;

Why

The DOM renderer passes marker position and keyed-list identity through an Effect service instead of a hidden component tree. It is published for renderer authors but is not normal application state.

Ownership and lifetime

A render Scope owns the referenced hydration cursor. Consumers must not retain or mutate it after that Scope closes.

Examples

import type { HydrateContext } from "@typed/template/HydrateContext"

declare const context: HydrateContext
context.where
import { HydrateContext } from "@typed/template/HydrateContext"
import { Effect } from "effect"

const current = Effect.gen(function* () {
  return (yield* HydrateContext).where
})

Other public imports

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

Source