MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / shouldYield

Function shouldYield

code/composition/public/app.js:14022–14033  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14020 // When working on async work, the reconciler asks the renderer if it should
14021 // yield execution. For DOM, we implement this with requestIdleCallback.
14022 function shouldYield() {
14023 if (deadline === null) {
14024 return false;
14025 }
14026 if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
14027 // Disregard deadline.didTimeout. Only expired work should be flushed
14028 // during a timeout. This path is only hit for non-expired work.
14029 return false;
14030 }
14031 deadlineDidExpire = true;
14032 return true;
14033 }
14034
14035 function onUncaughtError(error) {
14036 !(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