Skip to content
Snippets Groups Projects
Commit 1a09b94f authored by Isaac Evavold's avatar Isaac Evavold
Browse files

use trackBy to prevent all years from being rebuilt

parent 48ec8c9b
No related branches found
No related tags found
No related merge requests found
......@@ -157,9 +157,10 @@
style="margin: 24px">
<div id="year-mask" *ngIf="(isLoadingPlan$ | async)"></div>
<mat-accordion multi="true">
<ng-container *ngFor="let yearCode of (yearCodes$ | async)">
<cse-year-container [yearCode]="yearCode"></cse-year-container>
</ng-container>
<cse-year-container
*ngFor="let yearCode of yearCodes$ | async; trackBy: trackYearCodes"
[yearCode]="yearCode">
</cse-year-container>
</mat-accordion>
</div>
</mat-sidenav-content>
......
......@@ -235,6 +235,10 @@ export class DegreePlannerComponent implements OnInit, OnDestroy {
public closeCourseSearch() {
this.store.dispatch(new CloseCourseSearch());
}
public trackYearCodes(_index: number, yearCode: YearCode) {
return yearCode.toString();
}
}
const isntUndefined = <T>(anything: T | undefined): anything is T => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment