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

Function shouldYield

code/dependency-injection/public/app.js:13977–13988  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13975 // When working on async work, the reconciler asks the renderer if it should
13976 // yield execution. For DOM, we implement this with requestIdleCallback.
13977 function shouldYield() {
13978 if (deadline === null) {
13979 return false;
13980 }
13981 if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
13982 // Disregard deadline.didTimeout. Only expired work should be flushed
13983 // during a timeout. This path is only hit for non-expired work.
13984 return false;
13985 }
13986 deadlineDidExpire = true;
13987 return true;
13988 }
13989
13990 function onUncaughtError(error) {
13991 !(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