Skip to content

Commit dda9d9a

Browse files
committed
refactor(core): No need for zone.root.run in zoneless scheduler (#55230)
Now that #55092 has merged, we now consistently get the `setTimeout` and `rAF` implementations that are not patched by zone. There's no longer a need to run them in the root zone. PR Close #55230
1 parent 13d37e0 commit dda9d9a

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

packages/core/src/change_detection/scheduling/zoneless_scheduling_impl.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,9 @@ export class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler {
5151
}
5252

5353
this.pendingRenderTaskId = this.taskService.add();
54-
// TODO(atscott): This zone.root.run can maybe just be removed when we more
55-
// effectively get the unpatched versions of setTimeout and rAF (#55092)
56-
if (typeof Zone !== 'undefined' && Zone.root?.run) {
57-
Zone.root.run(() => {
58-
this.cancelScheduledCallback = scheduleCallback(() => {
59-
this.tick(this.shouldRefreshViews);
60-
});
61-
});
62-
} else {
63-
this.cancelScheduledCallback = scheduleCallback(() => {
64-
this.tick(this.shouldRefreshViews);
65-
});
66-
}
54+
this.cancelScheduledCallback = scheduleCallback(() => {
55+
this.tick(this.shouldRefreshViews);
56+
});
6757
}
6858

6959
private shouldScheduleTick(): boolean {

0 commit comments

Comments
 (0)