Skip to content

Commit

Permalink
fix(cdk): unsubscribe from swipe service when directive is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Sep 17, 2024
1 parent 58cd205 commit c25def4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/cdk/directives/swipe/swipe.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class TuiSwipeService extends Observable<TuiSwipeEvent> {
const el = tuiInjectElement();
const {timeout, threshold} = inject(TUI_SWIPE_OPTIONS);

super((subscriber) => {
super((subscriber) =>
merge(
tuiTypedFromEvent(el, 'touchstart', {passive: true}),
tuiTypedFromEvent(doc, 'touchend'),
Expand Down Expand Up @@ -53,8 +53,8 @@ export class TuiSwipeService extends Observable<TuiSwipeEvent> {
}),
filter(tuiIsPresent),
)
.subscribe(subscriber);
});
.subscribe(subscriber),
);
}
}

Expand Down

0 comments on commit c25def4

Please sign in to comment.