MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / completeRoot

Function completeRoot

code/communication/public/app.js:13894–13915  ·  view source on GitHub ↗
(root, finishedWork, expirationTime)

Source from the content-addressed store, hash-verified

13892 }
13893
13894 function completeRoot(root, finishedWork, expirationTime) {
13895 // Check if there's a batch that matches this expiration time.
13896 var firstBatch = root.firstBatch;
13897 if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) {
13898 if (completedBatches === null) {
13899 completedBatches = [firstBatch];
13900 } else {
13901 completedBatches.push(firstBatch);
13902 }
13903 if (firstBatch._defer) {
13904 // This root is blocked from committing by a batch. Unschedule it until
13905 // we receive another update.
13906 root.finishedWork = finishedWork;
13907 root.remainingExpirationTime = NoWork;
13908 return;
13909 }
13910 }
13911
13912 // Commit the root.
13913 root.finishedWork = null;
13914 root.remainingExpirationTime = commitRoot(finishedWork);
13915 }
13916
13917 // When working on async work, the reconciler asks the renderer if it should
13918 // yield execution. For DOM, we implement this with requestIdleCallback.

Callers 1

performWorkOnRootFunction · 0.70

Calls 1

commitRootFunction · 0.70

Tested by

no test coverage detected