-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supports synchronous scheduling in
effect
.
This broke for all signal changes after the first when using a synchronous `Scheduler` because `cancelNextCall = undefined` in the `.schedule` callback was getting invoked *before* the assignment to `cancelNextCall = scheduler.schedule(() => /* ... */)`, meaning the cancel function always exists. Since we used `cancelNextCall` to determine whether an operation was scheduled, `effect` incorrectly thought the action was still scheduled when it had actually already executed. This is fixed by using a distinct `scheduled` boolean which looks a bit redundant, but is necessary for the synchronous `Scheduler` case. Added a regression test to be more clear about this requirement.
- Loading branch information
Showing
2 changed files
with
37 additions
and
6 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