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

Function retry

packages/react-client/src/ReactFlightReplyClient.js:457–472  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

455 const lazyId = nextPartId++;
456 const thenable: Thenable<any> = (x: any);
457 const retry = function () {
458 // While the first promise resolved, its value isn't necessarily what we'll
459 // resolve into because we might suspend again.
460 try {
461 const partJSON = serializeModel(value, lazyId);
462 // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
463 const data: FormData = formData;
464 data.append(formFieldPrefix + lazyId, partJSON);
465 pendingParts--;
466 if (pendingParts === 0) {
467 resolve(data);
468 }
469 } catch (reason) {
470 reject(reason);
471 }
472 };
473 thenable.then(retry, retry);
474 return serializeByValueID(lazyId);
475 } else {

Callers

nothing calls this directly

Calls 4

serializeModelFunction · 0.85
appendMethod · 0.80
rejectFunction · 0.70
resolveFunction · 0.50

Tested by

no test coverage detected