(root, finishedWork, expirationTime)
| 13090 | } |
| 13091 | |
| 13092 | function completeRoot(root, finishedWork, expirationTime) { |
| 13093 | // Check if there's a batch that matches this expiration time. |
| 13094 | var firstBatch = root.firstBatch; |
| 13095 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 13096 | if (completedBatches === null) { |
| 13097 | completedBatches = [firstBatch]; |
| 13098 | } else { |
| 13099 | completedBatches.push(firstBatch); |
| 13100 | } |
| 13101 | if (firstBatch._defer) { |
| 13102 | // This root is blocked from committing by a batch. Unschedule it until |
| 13103 | // we receive another update. |
| 13104 | root.finishedWork = finishedWork; |
| 13105 | root.remainingExpirationTime = NoWork; |
| 13106 | return; |
| 13107 | } |
| 13108 | } |
| 13109 | |
| 13110 | // Commit the root. |
| 13111 | root.finishedWork = null; |
| 13112 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 13113 | } |
| 13114 | |
| 13115 | // When working on async work, the reconciler asks the renderer if it should |
| 13116 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected