MCPcopy Create free account
hub / github.com/solidjs/solid-start / deserializeJSStream

Function deserializeJSStream

packages/start/src/fns/serialization.ts:229–250  ·  view source on GitHub ↗
(id: string, response: Request | Response)

Source from the content-addressed store, hash-verified

227}
228
229export async function deserializeJSStream(id: string, response: Request | Response) {
230 if (!response.body) {
231 throw new Error("missing body");
232 }
233 const reader = new SerovalChunkReader(response.body);
234
235 const result = await reader.next();
236
237 if (!result.done) {
238 reader.drain(deserialize).then(
239 () => {
240 // @ts-ignore
241 delete $R[id];
242 },
243 () => {
244 // no-op
245 },
246 );
247 return deserialize(result.value);
248 }
249 return undefined;
250}

Callers 1

extractBodyFunction · 0.90

Calls 2

nextMethod · 0.95
drainMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…