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

Function shouldYield

code/redux/public/app.js:14135–14146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14133 // When working on async work, the reconciler asks the renderer if it should
14134 // yield execution. For DOM, we implement this with requestIdleCallback.
14135 function shouldYield() {
14136 if (deadline === null) {
14137 return false;
14138 }
14139 if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
14140 // Disregard deadline.didTimeout. Only expired work should be flushed
14141 // during a timeout. This path is only hit for non-expired work.
14142 return false;
14143 }
14144 deadlineDidExpire = true;
14145 return true;
14146 }
14147
14148 function onUncaughtError(error) {
14149 !(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