Skip to content

Commit

Permalink
fix(core): use destroyed service
Browse files Browse the repository at this point in the history
  • Loading branch information
N1XUS committed Jul 25, 2022
1 parent f1d3967 commit 45d37e8
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions libs/core/src/lib/breadcrumb/breadcrumb.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
EventEmitter,
Input,
isDevMode,
OnDestroy,
OnInit,
Optional,
Output,
Expand All @@ -18,8 +17,8 @@ import {
} from '@angular/core';
import { OverflowLayoutComponent } from '@fundamental-ngx/core/overflow-layout';
import { BreadcrumbItemComponent } from './breadcrumb-item.component';
import { RtlService } from '@fundamental-ngx/core/utils';
import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
import { DestroyedService, RtlService } from '@fundamental-ngx/core/utils';
import { BehaviorSubject, takeUntil } from 'rxjs';
import { MenuComponent } from '@fundamental-ngx/core/menu';
import { Placement } from '@fundamental-ngx/core/shared';

Expand All @@ -44,7 +43,7 @@ import { Placement } from '@fundamental-ngx/core/shared';
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class BreadcrumbComponent implements OnInit, AfterViewInit, OnDestroy {
export class BreadcrumbComponent implements OnInit, AfterViewInit {
/**
* @deprecated
* Breadcrumbs component now uses more advanced calculation mechanism without the need of specifying the container element.
Expand Down Expand Up @@ -89,8 +88,6 @@ export class BreadcrumbComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(OverflowLayoutComponent)
private readonly _overflowLayout: OverflowLayoutComponent;

private readonly _onDestroy$ = new Subject<void>();

/**
* @hidden
* Array of breadcrumb items.
Expand All @@ -103,6 +100,7 @@ export class BreadcrumbComponent implements OnInit, AfterViewInit, OnDestroy {
/** @hidden */
constructor(
public elementRef: ElementRef<HTMLElement>,
private _onDestroy$: DestroyedService,
@Optional() private _rtlService: RtlService | null,
private _cdr: ChangeDetectorRef
) {}
Expand All @@ -114,12 +112,6 @@ export class BreadcrumbComponent implements OnInit, AfterViewInit, OnDestroy {
.subscribe((value) => this._placement$.next(value ? 'bottom-end' : 'bottom-start'));
}

/** @hidden */
ngOnDestroy(): void {
this._onDestroy$.next();
this._onDestroy$.complete();
}

/** @hidden */
onResize(): void {
this._overflowLayout.triggerRecalculation();
Expand Down

0 comments on commit 45d37e8

Please sign in to comment.