MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / appendStreamingTextChunk

Function appendStreamingTextChunk

src/stream-chunk.ts:4–13  ·  view source on GitHub ↗
(parent: Element, text: string)

Source from the content-addressed store, hash-verified

2
3/** Append streamed plain text in its own animated reveal wrapper. */
4export function appendStreamingTextChunk(parent: Element, text: string): void {
5 if (!text) {
6 return;
7 }
8
9 const span = document.createElement("span");
10 span.className = STREAM_CHUNK_CLASS;
11 span.textContent = text;
12 parent.appendChild(span);
13}
14
15/** Flatten reveal wrappers when streaming finishes. */
16export function settleStreamChunks(root: ParentNode): void {

Callers 1

patchStreamingHtmlFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected