MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / ensureUpdateQueues

Function ensureUpdateQueues

code/composition/public/app.js:8046–8073  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

8044var q1 = void 0;
8045var q2 = void 0;
8046function ensureUpdateQueues(fiber) {
8047 q1 = q2 = null;
8048 // We'll have at least one and at most two distinct update queues.
8049 var alternateFiber = fiber.alternate;
8050 var queue1 = fiber.updateQueue;
8051 if (queue1 === null) {
8052 // TODO: We don't know what the base state will be until we begin work.
8053 // It depends on which fiber is the next current. Initialize with an empty
8054 // base state, then set to the memoizedState when rendering. Not super
8055 // happy with this approach.
8056 queue1 = fiber.updateQueue = createUpdateQueue(null);
8057 }
8058
8059 var queue2 = void 0;
8060 if (alternateFiber !== null) {
8061 queue2 = alternateFiber.updateQueue;
8062 if (queue2 === null) {
8063 queue2 = alternateFiber.updateQueue = createUpdateQueue(null);
8064 }
8065 } else {
8066 queue2 = null;
8067 }
8068 queue2 = queue2 !== queue1 ? queue2 : null;
8069
8070 // Use module variables instead of returning a tuple
8071 q1 = queue1;
8072 q2 = queue2;
8073}
8074
8075function insertUpdateIntoFiber(fiber, update) {
8076 ensureUpdateQueues(fiber);

Callers 2

insertUpdateIntoFiberFunction · 0.70
throwExceptionFunction · 0.70

Calls 1

createUpdateQueueFunction · 0.70

Tested by

no test coverage detected