(root, finishedWork, expirationTime)
| 13857 | } |
| 13858 | |
| 13859 | function completeRoot(root, finishedWork, expirationTime) { |
| 13860 | // Check if there's a batch that matches this expiration time. |
| 13861 | var firstBatch = root.firstBatch; |
| 13862 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 13863 | if (completedBatches === null) { |
| 13864 | completedBatches = [firstBatch]; |
| 13865 | } else { |
| 13866 | completedBatches.push(firstBatch); |
| 13867 | } |
| 13868 | if (firstBatch._defer) { |
| 13869 | // This root is blocked from committing by a batch. Unschedule it until |
| 13870 | // we receive another update. |
| 13871 | root.finishedWork = finishedWork; |
| 13872 | root.remainingExpirationTime = NoWork; |
| 13873 | return; |
| 13874 | } |
| 13875 | } |
| 13876 | |
| 13877 | // Commit the root. |
| 13878 | root.finishedWork = null; |
| 13879 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 13880 | } |
| 13881 | |
| 13882 | // When working on async work, the reconciler asks the renderer if it should |
| 13883 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected