variable / @typed/template/Wire

fromComments

Creates a published advanced Wire from a fragment and exact boundary comments.

Package version
1.0.0-beta.13
Category
Existing range boundaries
Since
1.0.0
Stability
internal-but-published

Import

import { fromComments } from "@typed/template/Wire";

Signatures

export declare const fromComments: (fragment: DocumentFragment, firstChild: Comment, lastChild: Comment) => Wire;

Why

Hydration and renderer extensions may already know the correct range markers and need to preserve them as one movable value.

Ownership and lifetime

The Wire retains the supplied nodes. It does not attach them or own their parent; the consuming render Scope owns mutations.

Examples

import { fromComments } from "@typed/template/Wire"

const fragment = document.createDocumentFragment()
const start = document.createComment("start")
const end = document.createComment("end")
const wire = fromComments(fragment, start, end)

Other public imports

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

Source