From 5ce088ab2becd92062f3f4ef94a0bf0a8373c975 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Wed, 18 Sep 2024 22:49:34 +0300 Subject: [PATCH] fix(cdk): unsubscribe from pan service when directive is destroyed (#9021) --- projects/cdk/directives/pan/pan.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/cdk/directives/pan/pan.service.ts b/projects/cdk/directives/pan/pan.service.ts index dfb010d02494..d0bc51806b24 100644 --- a/projects/cdk/directives/pan/pan.service.ts +++ b/projects/cdk/directives/pan/pan.service.ts @@ -19,7 +19,7 @@ export class TuiPanService extends Observable { const el = tuiInjectElement(); const doc = inject(DOCUMENT); - super((subscriber) => { + super((subscriber) => merge( tuiTypedFromEvent(el, 'touchstart', {passive: true}), tuiTypedFromEvent(el, 'mousedown'), @@ -51,7 +51,7 @@ export class TuiPanService extends Observable { ), repeat(), ) - .subscribe(subscriber); - }); + .subscribe(subscriber), + ); } }