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

Function emitRequestedDebugThenable

packages/react-server/src/ReactFlightServer.js:950–978  ·  view source on GitHub ↗
(
  request: Request,
  id: number,
  counter: {objectLimit: number},
  thenable: Thenable<any>,
)

Source from the content-addressed store, hash-verified

948}
949
950function emitRequestedDebugThenable(
951 request: Request,
952 id: number,
953 counter: {objectLimit: number},
954 thenable: Thenable<any>,
955): void {
956 thenable.then(
957 value => {
958 if (request.status === ABORTING) {
959 emitDebugHaltChunk(request, id);
960 enqueueFlush(request);
961 return;
962 }
963 emitOutlinedDebugModelChunk(request, id, counter, value);
964 enqueueFlush(request);
965 },
966 reason => {
967 if (request.status === ABORTING) {
968 emitDebugHaltChunk(request, id);
969 enqueueFlush(request);
970 return;
971 }
972 // We don't log these errors since they didn't actually throw into Flight.
973 const digest = '';
974 emitErrorChunk(request, id, digest, reason, true, null);
975 enqueueFlush(request);
976 },
977 );
978}
979
980function serializeThenable(
981 request: Request,

Callers 1

resolveDebugMessageFunction · 0.85

Calls 5

emitDebugHaltChunkFunction · 0.85
emitErrorChunkFunction · 0.85
enqueueFlushFunction · 0.70
thenMethod · 0.65

Tested by

no test coverage detected