MCPcopy
hub / github.com/facebook/react / pipe

Function pipe

packages/react-dom/src/server/ReactDOMFizzServerNode.js:143–165  ·  view source on GitHub ↗
(destination: T)

Source from the content-addressed store, hash-verified

141 startWork(request);
142 return {
143 pipe<T: Writable>(destination: T): T {
144 if (hasStartedFlowing) {
145 throw new Error(
146 'React currently only supports piping to one writable stream.',
147 );
148 }
149 hasStartedFlowing = true;
150 prepareForStartFlowingIfBeforeAllReady(request);
151 startFlowing(request, destination);
152 destination.on('drain', createDrainHandler(destination, request));
153 destination.on(
154 'error',
155 createCancelHandler(
156 request,
157 'The destination stream errored while writing data.',
158 ),
159 );
160 destination.on(
161 'close',
162 createCancelHandler(request, 'The destination stream closed early.'),
163 );
164 return destination;
165 },
166 abort(reason: mixed) {
167 abort(request, reason);
168 },

Callers 15

onShellReadyFunction · 0.50
IndirectionFunction · 0.50
onShellReadyFunction · 0.50
AFunction · 0.50
AppFunction · 0.50
FooFunction · 0.50
AbortFunction · 0.50

Calls 5

startFlowingFunction · 0.90
onMethod · 0.80
createDrainHandlerFunction · 0.70
createCancelHandlerFunction · 0.70

Tested by 7

onShellReadyFunction · 0.40
IndirectionFunction · 0.40
onShellReadyFunction · 0.40
AFunction · 0.40
AppFunction · 0.40
FooFunction · 0.40
AbortFunction · 0.40