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

Function shouldYield

code/higher-order-components/public/app.js:13878–13889  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13876 // When working on async work, the reconciler asks the renderer if it should
13877 // yield execution. For DOM, we implement this with requestIdleCallback.
13878 function shouldYield() {
13879 if (deadline === null) {
13880 return false;
13881 }
13882 if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
13883 // Disregard deadline.didTimeout. Only expired work should be flushed
13884 // during a timeout. This path is only hit for non-expired work.
13885 return false;
13886 }
13887 deadlineDidExpire = true;
13888 return true;
13889 }
13890
13891 function onUncaughtError(error) {
13892 !(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