Simplify test for whether we should flush a pending commit
We can just check if the deadline has expired.
Andrew Clark committed
Dec 13, 2016 at 15:49 UTC
df9603ead8c49f3638503f92ff56fcf07d137079
1 file changed
+3
-11
src/renderers/shared/fiber/ReactFiberScheduler.js
+3
-11
@@ -680,17 +680,9 @@ module.exports = function<T, P, I, TI, C, CX>(config : HostConfig<T, P, I, TI, C
680
}
681
682
// Before starting any work, check to see if there are any pending
683
- // commits from the previous frame. An exception is if we're flushing
684
- // Task work in a deferred batch and the pending commit does not
685
- // have Task priority.
686
- if (pendingCommit) {
687
- const isFlushingTaskWorkInDeferredBatch =
688
- priorityLevel === TaskPriority &&
689
- isPerformingDeferredWork &&
690
- pendingCommit.pendingWorkPriority !== TaskPriority;
691
- if (!isFlushingTaskWorkInDeferredBatch) {
692
- commitAllWork(pendingCommit);
693
- }
683
+ // commits from the previous frame.
684
+ if (pendingCommit && !deadlineHasExpired) {
685
+ commitAllWork(pendingCommit);
686
}
687
688
// Nothing in performWork should be allowed to throw. All unsafe