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

Function performUnitOfWork

code/one-direction-data-flow/public/app.js:13089–13122  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

13087 }
13088
13089 function performUnitOfWork(workInProgress) {
13090 // The current, flushed, state of this fiber is the alternate.
13091 // Ideally nothing should rely on this, but relying on it here
13092 // means that we don't need an additional field on the work in
13093 // progress.
13094 var current = workInProgress.alternate;
13095
13096 // See if beginning this work spawns more work.
13097 startWorkTimer(workInProgress);
13098 {
13099 ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
13100 }
13101
13102 if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
13103 stashedWorkInProgressProperties = _assign({}, workInProgress);
13104 }
13105 var next = beginWork(current, workInProgress, nextRenderExpirationTime);
13106
13107 {
13108 ReactDebugCurrentFiber.resetCurrentFiber();
13109 }
13110 if (true && ReactFiberInstrumentation_1.debugTool) {
13111 ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
13112 }
13113
13114 if (next === null) {
13115 // If this doesn't spawn new work, complete the current work.
13116 next = completeUnitOfWork(workInProgress);
13117 }
13118
13119 ReactCurrentOwner.current = null;
13120
13121 return next;
13122 }
13123
13124 function workLoop(isAsync) {
13125 if (!isAsync) {

Callers 1

workLoopFunction · 0.70

Calls 3

startWorkTimerFunction · 0.70
beginWorkFunction · 0.70
completeUnitOfWorkFunction · 0.70

Tested by

no test coverage detected