MCPcopy Index your code
hub / github.com/TanStack/router / start

Function start

packages/start-server-core/src/server-functions-handler.ts:245–261  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

243 // Create a stream of JSON chunks (NDJSON style)
244 const jsonStream = new ReadableStream<string>({
245 start(controller) {
246 callbacks.onParse = (value) => {
247 controller.enqueue(JSON.stringify(value) + '\n')
248 }
249 callbacks.onDone = () => {
250 try {
251 controller.close()
252 } catch {
253 // Already closed
254 }
255 }
256 callbacks.onError = (error) => controller.error(error)
257 // Emit initial body if we have one
258 if (nonStreamingBody !== undefined) {
259 callbacks.onParse(nonStreamingBody)
260 }
261 },
262 })
263
264 // Create multiplexed stream with JSON and raw streams

Callers

nothing calls this directly

Calls 3

enqueueMethod · 0.80
closeMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected