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

Function progress

packages/react-client/src/ReactFlightReplyClient.js:226–243  ·  packages/react-client/src/ReactFlightReplyClient.js::progress
(entry: {done: boolean, value: ReactServerValue, ...})

Source from the content-addressed store, hash-verified

224 const buffer = [];
225
226 function progress(entry: {done: boolean, value: ReactServerValue, ...}) {
227 if (entry.done) {
228 const blobId = nextPartId++;
229 data.append(formFieldPrefix + blobId, new Blob(buffer));
230 data.append(
231 formFieldPrefix + streamId,
232 class="st">'"$o' + blobId.toString(16) + class="st">'"',
233 );
234 data.append(formFieldPrefix + streamId, class="st">'C'); class="cm">// Close signal
235 pendingParts--;
236 if (pendingParts === 0) {
237 resolve(data);
238 }
239 } else {
240 buffer.push(entry.value);
241 reader.read(new Uint8Array(1024)).then(progress, reject);
242 }
243 }
244 reader.read(new Uint8Array(1024)).then(progress, reject);
245
246 return class="st">'$r' + streamId.toString(16);

Callers

nothing calls this directly

Calls 7

appendMethod · 0.80
nextMethod · 0.80
rejectFunction · 0.70
toStringMethod · 0.65
pushMethod · 0.65
thenMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected