-
Notifications
You must be signed in to change notification settings - Fork 46.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[scheduler] Pass didTimeout argument to callbacks (#14931)
As I prepare to refactor the Fiber scheduler, I've noticed some quirks in our implementation. This PR addressed one of them. --- There's no reason for a timed out Scheduler callback to check `shouldYield`, because the value will always be false until the work has completed. The `didTimeout` argument provides this information to the callback so it can avoid the redundant checks. React's existing check for whether a callback has timed out didn't make any sense, but happened to work anyway. I don't think the wrongness of the old implementation is observable via React APIs but it's incoherent regardless.
- Loading branch information
Showing
4 changed files
with
52 additions
and
24 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
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
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
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