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

Function shouldYield

code/third-party/public/app.js:13117–13128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13115 // When working on async work, the reconciler asks the renderer if it should
13116 // yield execution. For DOM, we implement this with requestIdleCallback.
13117 function shouldYield() {
13118 if (deadline === null) {
13119 return false;
13120 }
13121 if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
13122 // Disregard deadline.didTimeout. Only expired work should be flushed
13123 // during a timeout. This path is only hit for non-expired work.
13124 return false;
13125 }
13126 deadlineDidExpire = true;
13127 return true;
13128 }
13129
13130 function onUncaughtError(error) {
13131 !(nextFlushedRoot !== null) ? invariant(false, 'Should be working on a root. This error is likely caused by a bug in React. Please file an issue.') : void 0;

Callers 2

workLoopFunction · 0.70
performWorkOnRootFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected