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

Function performWork

code/composition/public/app.js:13870–13912  ·  view source on GitHub ↗
(minExpirationTime, isAsync, dl)

Source from the content-addressed store, hash-verified

13868 }
13869
13870 function performWork(minExpirationTime, isAsync, dl) {
13871 deadline = dl;
13872
13873 // Keep working on roots until there's no more work, or until the we reach
13874 // the deadline.
13875 findHighestPriorityRoot();
13876
13877 if (enableUserTimingAPI && deadline !== null) {
13878 var didExpire = nextFlushedExpirationTime < recalculateCurrentTime();
13879 stopRequestCallbackTimer(didExpire);
13880 }
13881
13882 if (isAsync) {
13883 while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || minExpirationTime >= nextFlushedExpirationTime) && (!deadlineDidExpire || recalculateCurrentTime() >= nextFlushedExpirationTime)) {
13884 performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, !deadlineDidExpire);
13885 findHighestPriorityRoot();
13886 }
13887 } else {
13888 while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || minExpirationTime >= nextFlushedExpirationTime)) {
13889 performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, false);
13890 findHighestPriorityRoot();
13891 }
13892 }
13893
13894 // We're done flushing work. Either we ran out of time in this callback,
13895 // or there's no more work left with sufficient priority.
13896
13897 // If we're inside a callback, set this to false since we just completed it.
13898 if (deadline !== null) {
13899 callbackExpirationTime = NoWork;
13900 callbackID = -1;
13901 }
13902 // If there's work left over, schedule a new callback.
13903 if (nextFlushedExpirationTime !== NoWork) {
13904 scheduleCallbackWithExpiration(nextFlushedExpirationTime);
13905 }
13906
13907 // Clean-up.
13908 deadline = null;
13909 deadlineDidExpire = false;
13910
13911 finishRendering();
13912 }
13913
13914 function flushRoot(root, expirationTime) {
13915 !!isRendering ? invariant(false, 'work.commit(): Cannot commit while already rendering. This likely means you attempted to commit from inside a lifecycle method.') : void 0;

Callers 5

performAsyncWorkFunction · 0.70
performSyncWorkFunction · 0.70
interactiveUpdatesFunction · 0.70
flushInteractiveUpdatesFunction · 0.70
flushControlledFunction · 0.70

Calls 6

findHighestPriorityRootFunction · 0.70
recalculateCurrentTimeFunction · 0.70
stopRequestCallbackTimerFunction · 0.70
performWorkOnRootFunction · 0.70
finishRenderingFunction · 0.70

Tested by

no test coverage detected