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

Function workLoop

code/new-context-api/public/app.js:12612–12624  ·  view source on GitHub ↗
(isAsync)

Source from the content-addressed store, hash-verified

12610 }
12611
12612 function workLoop(isAsync) {
12613 if (!isAsync) {
12614 // Flush all expired work.
12615 while (nextUnitOfWork !== null) {
12616 nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
12617 }
12618 } else {
12619 // Flush asynchronous work until the deadline runs out of time.
12620 while (nextUnitOfWork !== null && !shouldYield()) {
12621 nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
12622 }
12623 }
12624 }
12625
12626 function renderRoot(root, expirationTime, isAsync) {
12627 !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;

Callers 1

renderRootFunction · 0.70

Calls 2

performUnitOfWorkFunction · 0.70
shouldYieldFunction · 0.70

Tested by

no test coverage detected