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

Function performUnitOfWork

code/dependency-injection/public/app.js:13309–13342  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

13307 }
13308
13309 function performUnitOfWork(workInProgress) {
13310 // The current, flushed, state of this fiber is the alternate.
13311 // Ideally nothing should rely on this, but relying on it here
13312 // means that we don't need an additional field on the work in
13313 // progress.
13314 var current = workInProgress.alternate;
13315
13316 // See if beginning this work spawns more work.
13317 startWorkTimer(workInProgress);
13318 {
13319 ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
13320 }
13321
13322 if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
13323 stashedWorkInProgressProperties = _assign({}, workInProgress);
13324 }
13325 var next = beginWork(current, workInProgress, nextRenderExpirationTime);
13326
13327 {
13328 ReactDebugCurrentFiber.resetCurrentFiber();
13329 }
13330 if (true && ReactFiberInstrumentation_1.debugTool) {
13331 ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
13332 }
13333
13334 if (next === null) {
13335 // If this doesn't spawn new work, complete the current work.
13336 next = completeUnitOfWork(workInProgress);
13337 }
13338
13339 ReactCurrentOwner.current = null;
13340
13341 return next;
13342 }
13343
13344 function workLoop(isAsync) {
13345 if (!isAsync) {

Callers 1

workLoopFunction · 0.70

Calls 3

startWorkTimerFunction · 0.70
beginWorkFunction · 0.70
completeUnitOfWorkFunction · 0.70

Tested by

no test coverage detected