Skip to content

Commit 7979119

Browse files
committed
feat: add takeUntilDestroyed
1 parent a749de4 commit 7979119

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

projects/miles/src/app/miles-overview.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, inject } from '@angular/core';
2+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
23
import { UserPanel } from '@flights42/ui-common';
34
import { AuthService } from '@flights42/util-auth';
45

@@ -38,9 +39,11 @@ export class MilesOverview {
3839
private readonly authService = inject(AuthService);
3940

4041
constructor() {
41-
this.authService.userName.subscribe((userName) => {
42-
console.log('userName', userName ? userName : 'unknown');
43-
});
42+
this.authService.userName
43+
.pipe(takeUntilDestroyed())
44+
.subscribe((userName) => {
45+
console.log('userName', userName ? userName : 'unknown');
46+
});
4447
}
4548
}
4649

0 commit comments

Comments
 (0)