MCPcopy Create free account
hub / github.com/plotly/dash / processUpdateQueue

Function processUpdateQueue

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

Source from the content-addressed store, hash-verified

14849 }
14850
14851 function processUpdateQueue(workInProgress, props, instance, renderLanes) {
14852 // This is always non-null on a ClassComponent or HostRoot
14853 var queue = workInProgress.updateQueue;
14854 hasForceUpdate = false;
14855
14856 {
14857 currentlyProcessingQueue = queue.shared;
14858 }
14859
14860 var firstBaseUpdate = queue.firstBaseUpdate;
14861 var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue.
14862
14863 var pendingQueue = queue.shared.pending;
14864
14865 if (pendingQueue !== null) {
14866 queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first
14867 // and last so that it's non-circular.
14868
14869 var lastPendingUpdate = pendingQueue;
14870 var firstPendingUpdate = lastPendingUpdate.next;
14871 lastPendingUpdate.next = null; // Append pending updates to base queue
14872
14873 if (lastBaseUpdate === null) {
14874 firstBaseUpdate = firstPendingUpdate;
14875 } else {
14876 lastBaseUpdate.next = firstPendingUpdate;
14877 }
14878
14879 lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then
14880 // we need to transfer the updates to that queue, too. Because the base
14881 // queue is a singly-linked list with no cycles, we can append to both
14882 // lists and take advantage of structural sharing.
14883 // TODO: Pass `current` as argument
14884
14885 var current = workInProgress.alternate;
14886
14887 if (current !== null) {
14888 // This is always non-null on a ClassComponent or HostRoot
14889 var currentQueue = current.updateQueue;
14890 var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
14891
14892 if (currentLastBaseUpdate !== lastBaseUpdate) {
14893 if (currentLastBaseUpdate === null) {
14894 currentQueue.firstBaseUpdate = firstPendingUpdate;
14895 } else {
14896 currentLastBaseUpdate.next = firstPendingUpdate;
14897 }
14898
14899 currentQueue.lastBaseUpdate = lastPendingUpdate;
14900 }
14901 }
14902 } // These values may change as we process the queue.
14903
14904
14905 if (firstBaseUpdate !== null) {
14906 // Iterate through the list of updates to compute the result.
14907 var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes
14908 // 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…