(workInProgress, update)
| 11906 | } |
| 11907 | |
| 11908 | function enqueueCapturedUpdate(workInProgress, update) { |
| 11909 | // Captured updates go into a separate list, and only on the work-in- |
| 11910 | // progress queue. |
| 11911 | var workInProgressQueue = workInProgress.updateQueue; |
| 11912 | if (workInProgressQueue === null) { |
| 11913 | workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState); |
| 11914 | } else { |
| 11915 | // TODO: I put this here rather than createWorkInProgress so that we don't |
| 11916 | // clone the queue unnecessarily. There's probably a better way to |
| 11917 | // structure this. |
| 11918 | workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue); |
| 11919 | } |
| 11920 | |
| 11921 | // Append the update to the end of the list. |
| 11922 | if (workInProgressQueue.lastCapturedUpdate === null) { |
| 11923 | // This is the first render phase update |
| 11924 | workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update; |
| 11925 | } else { |
| 11926 | workInProgressQueue.lastCapturedUpdate.next = update; |
| 11927 | workInProgressQueue.lastCapturedUpdate = update; |
| 11928 | } |
| 11929 | } |
| 11930 | |
| 11931 | function ensureWorkInProgressQueueIsAClone(workInProgress, queue) { |
| 11932 | var current = workInProgress.alternate; |
no test coverage detected