(root, finishedWork, expirationTime)
| 13995 | } |
| 13996 | |
| 13997 | function completeRoot(root, finishedWork, expirationTime) { |
| 13998 | // Check if there's a batch that matches this expiration time. |
| 13999 | var firstBatch = root.firstBatch; |
| 14000 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 14001 | if (completedBatches === null) { |
| 14002 | completedBatches = [firstBatch]; |
| 14003 | } else { |
| 14004 | completedBatches.push(firstBatch); |
| 14005 | } |
| 14006 | if (firstBatch._defer) { |
| 14007 | // This root is blocked from committing by a batch. Unschedule it until |
| 14008 | // we receive another update. |
| 14009 | root.finishedWork = finishedWork; |
| 14010 | root.remainingExpirationTime = NoWork; |
| 14011 | return; |
| 14012 | } |
| 14013 | } |
| 14014 | |
| 14015 | // Commit the root. |
| 14016 | root.finishedWork = null; |
| 14017 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 14018 | } |
| 14019 | |
| 14020 | // When working on async work, the reconciler asks the renderer if it should |
| 14021 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected