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

Function workLoop

code/event-handlers/public/app.js:12581–12593  ·  view source on GitHub ↗
(isAsync)

Source from the content-addressed store, hash-verified

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