(fiber, update)
| 7265 | } |
| 7266 | |
| 7267 | function insertUpdateIntoFiber(fiber, update) { |
| 7268 | ensureUpdateQueues(fiber); |
| 7269 | var queue1 = q1; |
| 7270 | var queue2 = q2; |
| 7271 | |
| 7272 | // Warn if an update is scheduled from inside an updater function. |
| 7273 | { |
| 7274 | if ((queue1.isProcessing || queue2 !== null && queue2.isProcessing) && !didWarnUpdateInsideUpdate) { |
| 7275 | warning(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); |
| 7276 | didWarnUpdateInsideUpdate = true; |
| 7277 | } |
| 7278 | } |
| 7279 | |
| 7280 | // If there's only one queue, add the update to that queue and exit. |
| 7281 | if (queue2 === null) { |
| 7282 | insertUpdateIntoQueue(queue1, update); |
| 7283 | return; |
| 7284 | } |
| 7285 | |
| 7286 | // If either queue is empty, we need to add to both queues. |
| 7287 | if (queue1.last === null || queue2.last === null) { |
| 7288 | insertUpdateIntoQueue(queue1, update); |
| 7289 | insertUpdateIntoQueue(queue2, update); |
| 7290 | return; |
| 7291 | } |
| 7292 | |
| 7293 | // If both lists are not empty, the last update is the same for both lists |
| 7294 | // because of structural sharing. So, we should only append to one of |
| 7295 | // the lists. |
| 7296 | insertUpdateIntoQueue(queue1, update); |
| 7297 | // But we still need to update the `last` pointer of queue2. |
| 7298 | queue2.last = update; |
| 7299 | } |
| 7300 | |
| 7301 | function getUpdateExpirationTime(fiber) { |
| 7302 | switch (fiber.tag) { |
no test coverage detected