From 36ee7052e9ce5530b66154bbb4ff6e394a2eaa83 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Wed, 18 Sep 2024 10:41:31 +0300 Subject: [PATCH] fix(cdk): unsubscribe from zoom service when directive is destroyed (#9069) --- projects/cdk/directives/zoom/zoom.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/cdk/directives/zoom/zoom.service.ts b/projects/cdk/directives/zoom/zoom.service.ts index ceb34c722f81..edd35d42ee6b 100644 --- a/projects/cdk/directives/zoom/zoom.service.ts +++ b/projects/cdk/directives/zoom/zoom.service.ts @@ -14,7 +14,7 @@ export class TuiZoomService extends Observable { const el = tuiInjectElement(); const {wheelSensitivity} = inject(TUI_ZOOM_OPTIONS); - super((subscriber) => { + super((subscriber) => merge( tuiTypedFromEvent(el, 'touchstart', {passive: true}).pipe( filter(({touches}) => touches.length > 1), @@ -64,7 +64,7 @@ export class TuiZoomService extends Observable { event: wheel, })), ), - ).subscribe(subscriber); - }); + ).subscribe(subscriber), + ); } }