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

Function completeRoot

code/event-handlers/public/app.js:13189–13210  ·  view source on GitHub ↗
(root, finishedWork, expirationTime)

Source from the content-addressed store, hash-verified

13187 }
13188
13189 function completeRoot(root, finishedWork, expirationTime) {
13190 // Check if there's a batch that matches this expiration time.
13191 var firstBatch = root.firstBatch;
13192 if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) {
13193 if (completedBatches === null) {
13194 completedBatches = [firstBatch];
13195 } else {
13196 completedBatches.push(firstBatch);
13197 }
13198 if (firstBatch._defer) {
13199 // This root is blocked from committing by a batch. Unschedule it until
13200 // we receive another update.
13201 root.finishedWork = finishedWork;
13202 root.remainingExpirationTime = NoWork;
13203 return;
13204 }
13205 }
13206
13207 // Commit the root.
13208 root.finishedWork = null;
13209 root.remainingExpirationTime = commitRoot(finishedWork);
13210 }
13211
13212 // When working on async work, the reconciler asks the renderer if it should
13213 // 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