StreamBoundary
A Suspense boundary whose content was not ready when the shell rendered: renderToStream calls rebuild again each time a resource settles, and streams the markup once it is complete.
A Suspense boundary whose content was not ready when the shell rendered: renderToStream calls
rebuild again each time a resource settles, and streams the markup once it is complete.
Import#
ts
import type { StreamBoundary } from "@shadow-js/web/extend";
Signature#
ts
interface StreamBoundary {
/**
* The boundary's hydration key. The shell must wrap the fallback in `<!--[b:ID-->` and `<!--]-->`
* comments so the streamed chunk can replace it.
*/
readonly id: string;
/**
* Renders the content again. Returns its final markup, or `null` when it is still pending, in which
* case it has deferred itself again with {@link StreamSink.defer}.
*/
rebuild(): string | null;
}
Members#
| Name | Type | Description |
|---|---|---|
id |
readonly id: string |
The boundary's hydration key. The shell must wrap the fallback in <!--[b:ID--> and <!--]--> comments so the streamed chunk can replace it. |
rebuild |
rebuild(): string | null |
Renders the content again. Returns its final markup, or null when it is still pending, in which case it has deferred itself again with StreamSink.defer. |