MCPcopy
hub / github.com/plotly/dash / processUpdateQueue

Function processUpdateQueue

dash/deps/react-dom@18.2.0.js:13738–13926  ·  view source on GitHub ↗
(workInProgress, props, instance, renderLanes)

Source from the content-addressed store, hash-verified

13736 }
13737
13738 function processUpdateQueue(workInProgress, props, instance, renderLanes) {
13739 // This is always non-null on a ClassComponent or HostRoot
13740 var queue = workInProgress.updateQueue;
13741 hasForceUpdate = false;
13742
13743 {
13744 currentlyProcessingQueue = queue.shared;
13745 }
13746
13747 var firstBaseUpdate = queue.firstBaseUpdate;
13748 var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue.
13749
13750 var pendingQueue = queue.shared.pending;
13751
13752 if (pendingQueue !== null) {
13753 queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first
13754 // and last so that it's non-circular.
13755
13756 var lastPendingUpdate = pendingQueue;
13757 var firstPendingUpdate = lastPendingUpdate.next;
13758 lastPendingUpdate.next = null; // Append pending updates to base queue
13759
13760 if (lastBaseUpdate === null) {
13761 firstBaseUpdate = firstPendingUpdate;
13762 } else {
13763 lastBaseUpdate.next = firstPendingUpdate;
13764 }
13765
13766 lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then
13767 // we need to transfer the updates to that queue, too. Because the base
13768 // queue is a singly-linked list with no cycles, we can append to both
13769 // lists and take advantage of structural sharing.
13770 // TODO: Pass `current` as argument
13771
13772 var current = workInProgress.alternate;
13773
13774 if (current !== null) {
13775 // This is always non-null on a ClassComponent or HostRoot
13776 var currentQueue = current.updateQueue;
13777 var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
13778
13779 if (currentLastBaseUpdate !== lastBaseUpdate) {
13780 if (currentLastBaseUpdate === null) {
13781 currentQueue.firstBaseUpdate = firstPendingUpdate;
13782 } else {
13783 currentLastBaseUpdate.next = firstPendingUpdate;
13784 }
13785
13786 currentQueue.lastBaseUpdate = lastPendingUpdate;
13787 }
13788 }
13789 } // These values may change as we process the queue.
13790
13791
13792 if (firstBaseUpdate !== null) {
13793 // Iterate through the list of updates to compute the result.
13794 var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes
13795 // from the original lanes.

Callers 4

mountClassInstanceFunction · 0.70
resumeMountClassInstanceFunction · 0.70
updateClassInstanceFunction · 0.70
updateHostRootFunction · 0.70

Calls 5

pushMethod · 0.80
isSubsetOfLanesFunction · 0.70
mergeLanesFunction · 0.70
getStateFromUpdateFunction · 0.70
markSkippedUpdateLanesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…