-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Scheduler] Check for continuous input events (#22107)
* [Scheduler] Track start of current chunk Currently in `shouldYield`, we compare the current time to a deadline that is pre-computed at the beginning of the current chunk. However, since we use different deadlines depending on whether an input event is pending, it makes more sense to track the start of the current chunk and check how much time has elapsed since then. Doesn't change any behavior, just refactors the logic. * [Scheduler] Check for continuous input events `isInputPending` supports a `includeContinuous` option. When set to `true`, the method will check for pending continuous inputs, like `mousemove`, in addition to discrete ones, like `click`. We will only check for pending continuous inputs if we've blocked the main thread for a non-neglible amount of time. If we've only blocked the main thread for, say, a few frames, then we'll only check for discrete inputs. I wrote a test for this but didn't include it because we haven't yet set up the `gate` flag infra to work with Scheduler feature flags. For now, I ran the test locally. * Review nits
- Loading branch information
Showing
1 changed file
with
57 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters