MCPcopy Create free account
hub / github.com/ethanniser/the-beth-stack / start

Function start

packages/beth-stack/src/jsx/render.ts:38–51  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

36 BETH_GLOBAL_RENDER_CACHE.reset();
37 const stream = new ReadableStream<string>({
38 start(c) {
39 BETH_GLOBAL_RENDER_CACHE.streamController = c;
40 lazyHtml()
41 .then((data) => {
42 BETH_GLOBAL_RENDER_CACHE.streamController?.enqueue(data);
43 BETH_GLOBAL_RENDER_CACHE.checkIfEndAndClose();
44 })
45 .catch((error) => {
46 console.error("Error in promise:", error);
47 // Handle error appropriately
48 BETH_GLOBAL_RENDER_CACHE.streamController?.error(error);
49 BETH_GLOBAL_RENDER_CACHE.closeNow();
50 });
51 },
52 });
53
54 return stream;

Callers

nothing calls this directly

Calls 2

checkIfEndAndCloseMethod · 0.80
closeNowMethod · 0.80

Tested by

no test coverage detected