MCPcopy Index your code
hub / github.com/solidjs/solid-start / serializeToJSStream

Function serializeToJSStream

packages/start/src/fns/serialization.ts:69–89  ·  view source on GitHub ↗
(id: string, value: any)

Source from the content-addressed store, hash-verified

67}
68
69export function serializeToJSStream(id: string, value: any) {
70 return new ReadableStream({
71 start(controller) {
72 crossSerializeStream(value, {
73 scopeId: id,
74 plugins: DEFAULT_PLUGINS,
75 onSerialize(data: string, initial: boolean) {
76 controller.enqueue(
77 createChunk(initial ? `(${getCrossReferenceHeader(id)},${data})` : data),
78 );
79 },
80 onDone() {
81 controller.close();
82 },
83 onError(error: any) {
84 controller.error(error);
85 },
86 });
87 },
88 });
89}
90
91export function serializeToJSONStream(value: any) {
92 return new ReadableStream({

Callers 1

handleServerFunctionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…