MCPcopy Index your code
hub / github.com/caseywebdev/react-list / updateReducerImpl

Function updateReducerImpl

docs/index.js:7398–7502  ·  view source on GitHub ↗
(hook, current, reducer)

Source from the content-addressed store, hash-verified

7396 return updateReducerImpl(hook, currentHook, reducer);
7397}
7398function updateReducerImpl(hook, current, reducer) {
7399 var queue = hook.queue;
7400 if (null === queue) throw Error(formatProdErrorMessage(311));
7401 queue.lastRenderedReducer = reducer;
7402 var baseQueue = hook.baseQueue,
7403 pendingQueue = queue.pending;
7404 if (null !== pendingQueue) {
7405 if (null !== baseQueue) {
7406 var baseFirst = baseQueue.next;
7407 baseQueue.next = pendingQueue.next;
7408 pendingQueue.next = baseFirst;
7409 }
7410 current.baseQueue = baseQueue = pendingQueue;
7411 queue.pending = null;
7412 }
7413 pendingQueue = hook.baseState;
7414 if (null === baseQueue) hook.memoizedState = pendingQueue;
7415 else {
7416 current = baseQueue.next;
7417 var newBaseQueueFirst = (baseFirst = null),
7418 newBaseQueueLast = null,
7419 update = current,
7420 didReadFromEntangledAsyncAction$54 = !1;
7421 do {
7422 var updateLane = update.lane & -536870913;
7423 if (
7424 updateLane !== update.lane
7425 ? (workInProgressRootRenderLanes & updateLane) === updateLane
7426 : (renderLanes & updateLane) === updateLane
7427 ) {
7428 var revertLane = update.revertLane;
7429 if (0 === revertLane)
7430 null !== newBaseQueueLast &&
7431 (newBaseQueueLast = newBaseQueueLast.next =
7432 {
7433 lane: 0,
7434 revertLane: 0,
7435 action: update.action,
7436 hasEagerState: update.hasEagerState,
7437 eagerState: update.eagerState,
7438 next: null
7439 }),
7440 updateLane === currentEntangledLane &&
7441 (didReadFromEntangledAsyncAction$54 = !0);
7442 else if ((renderLanes & revertLane) === revertLane) {
7443 update = update.next;
7444 revertLane === currentEntangledLane &&
7445 (didReadFromEntangledAsyncAction$54 = !0);
7446 continue;
7447 } else
7448 (updateLane = {
7449 lane: 0,
7450 revertLane: update.revertLane,
7451 action: update.action,
7452 hasEagerState: update.hasEagerState,
7453 eagerState: update.eagerState,
7454 next: null
7455 }),

Callers 3

updateReducerFunction · 0.85
updateOptimisticImplFunction · 0.85
updateActionStateImplFunction · 0.85

Calls 1

formatProdErrorMessageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…