From ff0e79425bf6c31721346f6036011713f730a561 Mon Sep 17 00:00:00 2001 From: bnymncoskuner Date: Tue, 30 Mar 2021 18:34:32 +0300 Subject: [PATCH] fix: store subscription of shouldRender --- .../packages/components/page/src/page-part.directive.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/components/page/src/page-part.directive.ts b/npm/ng-packs/packages/components/page/src/page-part.directive.ts index 74ad59c26c..3e59b7aee2 100644 --- a/npm/ng-packs/packages/components/page/src/page-part.directive.ts +++ b/npm/ng-packs/packages/components/page/src/page-part.directive.ts @@ -18,7 +18,7 @@ import { Observable, Subscription, of } from 'rxjs'; export interface PageRenderStrategy { shouldRender(type?: string): boolean | Observable; onInit?(type?: string, injector?: Injector, context?: any): void; - onDestroy?(type: string, injector?: Injector, context?: any): void; + onDestroy?(type?: string, injector?: Injector, context?: any): void; onContextUpdate?(change?: SimpleChange): void; } @@ -84,7 +84,7 @@ export class PagePartDirective implements OnInit, OnDestroy, OnChanges { protected createRenderStream(type: string) { this.clearSubscription(); - this.shouldRender(type).subscribe(this.render); + this.subscription = this.shouldRender(type).subscribe(this.render); } protected clearSubscription() {