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

Function closeDebugChannel

packages/react-server/src/ReactFlightServer.js:6280–6301  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

6278}
6279
6280export function closeDebugChannel(request: Request): void {
6281 if (!__DEV__) {
6282 // These errors should never make it into a build so we don't need to encode them in codes.json
6283 // eslint-disable-next-line react-internal/prod-error-codes
6284 throw new Error(
6285 'closeDebugChannel should never be called in production mode. This is a bug in React.',
6286 );
6287 }
6288 // This clears all remaining deferred objects, potentially resulting in the completion of the Request.
6289 const deferredDebugObjects = request.deferredDebugObjects;
6290 if (deferredDebugObjects === null) {
6291 throw new Error(
6292 "resolveDebugMessage/closeDebugChannel should not be called for a Request that wasn't kept alive. This is a bug in React.",
6293 );
6294 }
6295 deferredDebugObjects.retained.forEach((value, id) => {
6296 request.pendingDebugChunks--;
6297 deferredDebugObjects.retained.delete(id);
6298 deferredDebugObjects.existing.delete(value);
6299 });
6300 enqueueFlush(request);
6301}

Callers 15

progressFunction · 0.90
progressFunction · 0.90
onCloseFunction · 0.90
progressFunction · 0.90
progressFunction · 0.90
progressFunction · 0.90
onCloseFunction · 0.90
progressFunction · 0.90
onCloseFunction · 0.90
progressFunction · 0.90
progressFunction · 0.90
progressFunction · 0.90

Calls 2

enqueueFlushFunction · 0.70
forEachMethod · 0.65

Tested by

no test coverage detected