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

Function progress

packages/react-server/src/ReactFlightServer.js:1130–1154  ·  view source on GitHub ↗
(entry: {done: boolean, value: ReactClientValue, ...})

Source from the content-addressed store, hash-verified

1128 request.completedRegularChunks.push(stringToChunk(startStreamRow));
1129
1130 function progress(entry: {done: boolean, value: ReactClientValue, ...}) {
1131 if (streamTask.status !== PENDING) {
1132 return;
1133 }
1134
1135 if (entry.done) {
1136 streamTask.status = COMPLETED;
1137 const endStreamRow = streamTask.id.toString(16) + ':C\n';
1138 request.completedRegularChunks.push(stringToChunk(endStreamRow));
1139 request.abortableTasks.delete(streamTask);
1140 request.cacheController.signal.removeEventListener('abort', abortStream);
1141 enqueueFlush(request);
1142 callOnAllReadyIfReady(request);
1143 } else {
1144 try {
1145 streamTask.model = entry.value;
1146 request.pendingChunks++;
1147 tryStreamTask(request, streamTask);
1148 enqueueFlush(request);
1149 reader.read().then(progress, error);
1150 } catch (x) {
1151 error(x);
1152 }
1153 }
1154 }
1155 function error(reason: mixed) {
1156 if (streamTask.status !== PENDING) {
1157 return;

Callers

nothing calls this directly

Calls 14

stringToChunkFunction · 0.90
callOnAllReadyIfReadyFunction · 0.85
tryStreamTaskFunction · 0.85
outlineModelFunction · 0.85
stringifyFunction · 0.85
nextMethod · 0.80
enqueueFlushFunction · 0.70
errorFunction · 0.70
serializeByValueIDFunction · 0.70
pingTaskFunction · 0.70
toStringMethod · 0.65

Tested by

no test coverage detected