MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / completeRoot

Function completeRoot

code/redux/public/app.js:14110–14131  ·  view source on GitHub ↗
(root, finishedWork, expirationTime)

Source from the content-addressed store, hash-verified

14108 }
14109
14110 function completeRoot(root, finishedWork, expirationTime) {
14111 // Check if there's a batch that matches this expiration time.
14112 var firstBatch = root.firstBatch;
14113 if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) {
14114 if (completedBatches === null) {
14115 completedBatches = [firstBatch];
14116 } else {
14117 completedBatches.push(firstBatch);
14118 }
14119 if (firstBatch._defer) {
14120 // This root is blocked from committing by a batch. Unschedule it until
14121 // we receive another update.
14122 root.finishedWork = finishedWork;
14123 root.remainingExpirationTime = NoWork;
14124 return;
14125 }
14126 }
14127
14128 // Commit the root.
14129 root.finishedWork = null;
14130 root.remainingExpirationTime = commitRoot(finishedWork);
14131 }
14132
14133 // When working on async work, the reconciler asks the renderer if it should
14134 // 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