Make NoWork big instead of small

This commit is contained in:
Sophie Alpert
2018-10-20 00:16:42 -07:00
parent 7268d97d2b
commit a684f09e58
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -11,9 +11,9 @@ import MAX_SIGNED_31_BIT_INT from './maxSigned31BitInt';
export type ExpirationTime = number;
export const NoWork = 0;
export const NoWork = MAX_SIGNED_31_BIT_INT;
export const Sync = 1;
export const Never = MAX_SIGNED_31_BIT_INT;
export const Never = MAX_SIGNED_31_BIT_INT - 1;
const UNIT_SIZE = 10;
const MAGIC_NUMBER_OFFSET = 2;
+4 -1
View File
@@ -1545,7 +1545,10 @@ function computeExpirationForFiber(currentTime: ExpirationTime, fiber: Fiber) {
// This is an interactive update. Keep track of the lowest pending
// interactive expiration time. This allows us to synchronously flush
// all interactive updates when needed.
if (expirationTime > lowestPriorityPendingInteractiveExpirationTime) {
if (
lowestPriorityPendingInteractiveExpirationTime === NoWork ||
expirationTime > lowestPriorityPendingInteractiveExpirationTime
) {
lowestPriorityPendingInteractiveExpirationTime = expirationTime;
}
}
@@ -249,7 +249,7 @@ exports[`ReactDebugFiberPerf measures deprioritized work 1`] = `
⚛ (Committing Host Effects: 1 Total)
⚛ (Calling Lifecycle Methods: 0 Total)
⚛ (Waiting for async callback... will force flush in 10737418210 ms)
⚛ (Waiting for async callback... will force flush in 10737418200 ms)
// Flush the child
⚛ (React Tree Reconciliation: Completed Root)