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

Function completeRoot

code/dependency-injection/public/app.js:13952–13973  ·  view source on GitHub ↗
(root, finishedWork, expirationTime)

Source from the content-addressed store, hash-verified

13950 }
13951
13952 function completeRoot(root, finishedWork, expirationTime) {
13953 // Check if there's a batch that matches this expiration time.
13954 var firstBatch = root.firstBatch;
13955 if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) {
13956 if (completedBatches === null) {
13957 completedBatches = [firstBatch];
13958 } else {
13959 completedBatches.push(firstBatch);
13960 }
13961 if (firstBatch._defer) {
13962 // This root is blocked from committing by a batch. Unschedule it until
13963 // we receive another update.
13964 root.finishedWork = finishedWork;
13965 root.remainingExpirationTime = NoWork;
13966 return;
13967 }
13968 }
13969
13970 // Commit the root.
13971 root.finishedWork = null;
13972 root.remainingExpirationTime = commitRoot(finishedWork);
13973 }
13974
13975 // When working on async work, the reconciler asks the renderer if it should
13976 // 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