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

Function workLoop

code/controlled-uncontrolled/public/app.js:12575–12587  ·  view source on GitHub ↗
(isAsync)

Source from the content-addressed store, hash-verified

12573 }
12574
12575 function workLoop(isAsync) {
12576 if (!isAsync) {
12577 // Flush all expired work.
12578 while (nextUnitOfWork !== null) {
12579 nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
12580 }
12581 } else {
12582 // Flush asynchronous work until the deadline runs out of time.
12583 while (nextUnitOfWork !== null && !shouldYield()) {
12584 nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
12585 }
12586 }
12587 }
12588
12589 function renderRoot(root, expirationTime, isAsync) {
12590 !!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