-
Notifications
You must be signed in to change notification settings - Fork 26.5k
fix(core): execute timer trigger outside zone #60392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e6366fa
to
0f5cc98
Compare
This should prevent defer timers from impacting app stability by executing them outside of the zone, similar to other defer triggers. fixes: angular#60373
0f5cc98
to
768a9e1
Compare
This PR was merged into the repository by commit b8daf47. The changes were merged into the following branches: main, 19.2.x |
@@ -60,10 +62,10 @@ export class TimerScheduler { | |||
// as the shape of the `current` list. | |||
deferred: Array<number | VoidFunction> = []; | |||
|
|||
add(delay: number, callback: VoidFunction) { | |||
add(delay: number, callback: VoidFunction, ngZone: NgZone) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since TimerScheduler
is an injectable class, we could avoid passing ngZone
as an argument, but instead just inject it in the class directly (using the inject
function).
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This should prevent defer timers from impacting app stability by executing them outside of the zone, similar to other defer triggers. This should also affect
minimum
andafter
time values in placeholder and loading templates for defer blocks, as they use the sameTimerScheduler
.Does this PR introduce a breaking change?