MCPcopy Index your code
hub / github.com/microsoft/SandDance / processUpdateQueue

Function processUpdateQueue

docs/external/js/react-dom.development.js:12457–12616  ·  view source on GitHub ↗
(workInProgress, props, instance, renderExpirationTime)

Source from the content-addressed store, hash-verified

12455 }
12456
12457 function processUpdateQueue(workInProgress, props, instance, renderExpirationTime) {
12458 // This is always non-null on a ClassComponent or HostRoot
12459 var queue = workInProgress.updateQueue;
12460 hasForceUpdate = false;
12461
12462 {
12463 currentlyProcessingQueue = queue.shared;
12464 } // The last rebase update that is NOT part of the base state.
12465
12466
12467 var baseQueue = queue.baseQueue; // The last pending update that hasn't been processed yet.
12468
12469 var pendingQueue = queue.shared.pending;
12470
12471 if (pendingQueue !== null) {
12472 // We have new updates that haven't been processed yet.
12473 // We'll add them to the base queue.
12474 if (baseQueue !== null) {
12475 // Merge the pending queue and the base queue.
12476 var baseFirst = baseQueue.next;
12477 var pendingFirst = pendingQueue.next;
12478 baseQueue.next = pendingFirst;
12479 pendingQueue.next = baseFirst;
12480 }
12481
12482 baseQueue = pendingQueue;
12483 queue.shared.pending = null; // TODO: Pass `current` as argument
12484
12485 var current = workInProgress.alternate;
12486
12487 if (current !== null) {
12488 var currentQueue = current.updateQueue;
12489
12490 if (currentQueue !== null) {
12491 currentQueue.baseQueue = pendingQueue;
12492 }
12493 }
12494 } // These values may change as we process the queue.
12495
12496
12497 if (baseQueue !== null) {
12498 var first = baseQueue.next; // Iterate through the list of updates to compute the result.
12499
12500 var newState = queue.baseState;
12501 var newExpirationTime = NoWork;
12502 var newBaseState = null;
12503 var newBaseQueueFirst = null;
12504 var newBaseQueueLast = null;
12505
12506 if (first !== null) {
12507 var update = first;
12508
12509 do {
12510 var updateExpirationTime = update.expirationTime;
12511
12512 if (updateExpirationTime < renderExpirationTime) {
12513 // Priority is insufficient. Skip this update. If this is the first
12514 // skipped update, the previous update/state is the new base

Callers 4

mountClassInstanceFunction · 0.85
resumeMountClassInstanceFunction · 0.85
updateClassInstanceFunction · 0.85
updateHostRootFunction · 0.85

Calls 3

getStateFromUpdateFunction · 0.85

Tested by

no test coverage detected