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

Function workLoop

code/one-direction-data-flow/public/app.js:13124–13136  ·  view source on GitHub ↗
(isAsync)

Source from the content-addressed store, hash-verified

13122 }
13123
13124 function workLoop(isAsync) {
13125 if (!isAsync) {
13126 // Flush all expired work.
13127 while (nextUnitOfWork !== null) {
13128 nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
13129 }
13130 } else {
13131 // Flush asynchronous work until the deadline runs out of time.
13132 while (nextUnitOfWork !== null && !shouldYield()) {
13133 nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
13134 }
13135 }
13136 }
13137
13138 function renderRoot(root, expirationTime, isAsync) {
13139 !!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