Skip to content
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

perf(module:table): spawn timers and add listener outside of the zone #7140

Merged
merged 1 commit into from Feb 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/table/src/table/table-inner-scroll.component.ts
Expand Up @@ -152,10 +152,13 @@ export class NzTableInnerScrollComponent<T> implements OnChanges, AfterViewInit,
overflowX: this.scrollX ? 'auto' : null,
maxHeight: this.scrollY
};
this.scroll$.next();
// Caretaker note: we have to emit the value outside of the Angular zone, thus DOM timer (`delay(0)`) and `scroll`
// event listener will be also added outside of the Angular zone.
this.ngZone.runOutsideAngular(() => this.scroll$.next());
}
if (data) {
this.data$.next();
// See the comment above.
this.ngZone.runOutsideAngular(() => this.data$.next());
}
}
ngAfterViewInit(): void {
Expand Down