MCPcopy
hub / github.com/TanStack/router / getOrCreateStream

Function getOrCreateStream

packages/router-core/tests/RawStream.test.ts:132–139  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

130
131 // getOrCreateStream function that returns from map
132 const getOrCreateStream = (id: number) => {
133 let stream = streams.get(id)
134 if (!stream) {
135 stream = new ReadableStream<Uint8Array>()
136 streams.set(id, stream)
137 }
138 return stream
139 }
140
141 const plugin = createRawStreamDeserializePlugin(getOrCreateStream)
142

Callers 1

deserializeFunction · 0.50

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected