Skip to content

Commit

Permalink
Review nits
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Aug 16, 2021
1 parent e28bcce commit 5cce438
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/scheduler/src/forks/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ const isInputPending =
? navigator.scheduling.isInputPending.bind(navigator.scheduling)
: null;

const continuousOptions = {includeContinuous: true};

function advanceTimers(currentTime) {
// Check for tasks that are no longer delayed and add them to the queue.
let timer = peek(timerQueue);
Expand Down Expand Up @@ -464,7 +466,7 @@ function shouldYieldToHost() {
} else if (timeElapsed < maxInterval) {
// Yield if there's either a pending discrete or continuous input.
if (isInputPending !== null) {
return isInputPending({includeContinuous: true});
return isInputPending(continuousOptions);
}
} else {
// We've blocked the thread for a long time. Even if there's no pending
Expand Down Expand Up @@ -511,9 +513,8 @@ function forceFrameRate(fps) {
const performWorkUntilDeadline = () => {
if (scheduledHostCallback !== null) {
const currentTime = getCurrentTime();
// Yield after `yieldInterval` ms, regardless of where we are in the vsync
// cycle. This means there's always time remaining at the beginning of
// the message event.
// Keep track of the start time so we can measure how long the main thread
// has been blocked.
startTime = currentTime;
const hasTimeRemaining = true;

Expand Down

0 comments on commit 5cce438

Please sign in to comment.