@@ -17,7 +17,7 @@ import { IgxNavigationService, IToggleView } from '../../core/navigation';
17
17
import { IgxOverlayService } from '../../services/overlay/overlay' ;
18
18
import { OverlaySettings , OverlayEventArgs , ConnectedPositioningStrategy , AbsoluteScrollStrategy } from '../../services' ;
19
19
import { filter , takeUntil } from 'rxjs/operators' ;
20
- import { Subscription , OperatorFunction , Subject } from 'rxjs' ;
20
+ import { Subscription , Subject , MonoTypeOperatorFunction } from 'rxjs' ;
21
21
import { OverlayCancelableEventArgs } from '../../services/overlay/utilities' ;
22
22
import { CancelableEventArgs } from '../../core/utils' ;
23
23
@@ -28,8 +28,9 @@ import { CancelableEventArgs } from '../../core/utils';
28
28
export class IgxToggleDirective implements IToggleView , OnInit , OnDestroy {
29
29
private _overlayId : string ;
30
30
private destroy$ = new Subject < boolean > ( ) ;
31
- private _overlaySubFilter : OperatorFunction < OverlayEventArgs , OverlayEventArgs > [ ] = [
32
- filter ( x => x . id === this . _overlayId )
31
+ private _overlaySubFilter : [ MonoTypeOperatorFunction < OverlayEventArgs > , MonoTypeOperatorFunction < OverlayEventArgs > ] = [
32
+ filter ( x => x . id === this . _overlayId ) ,
33
+ takeUntil ( this . destroy$ )
33
34
] ;
34
35
private _overlayOpenedSub : Subscription ;
35
36
private _overlayClosingSub : Subscription ;
@@ -189,12 +190,12 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
189
190
}
190
191
191
192
this . unsubscribe ( ) ;
192
- this . _overlayOpenedSub = this . overlayService . onOpened . pipe ( ...this . _overlaySubFilter , takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
193
+ this . _overlayOpenedSub = this . overlayService . onOpened . pipe ( ...this . _overlaySubFilter ) . subscribe ( ( ) => {
193
194
this . onOpened . emit ( ) ;
194
195
} ) ;
195
196
this . _overlayClosingSub = this . overlayService
196
197
. onClosing
197
- . pipe ( ...this . _overlaySubFilter , takeUntil ( this . destroy$ ) )
198
+ . pipe ( ...this . _overlaySubFilter )
198
199
. subscribe ( ( e : OverlayCancelableEventArgs ) => {
199
200
const eventArgs : CancelableEventArgs = { cancel : false } ;
200
201
this . onClosing . emit ( eventArgs ) ;
@@ -208,7 +209,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
208
209
}
209
210
} ) ;
210
211
this . _overlayClosedSub = this . overlayService . onClosed
211
- . pipe ( ...this . _overlaySubFilter , takeUntil ( this . destroy$ ) )
212
+ . pipe ( ...this . _overlaySubFilter )
212
213
. subscribe ( this . overlayClosed ) ;
213
214
}
214
215
0 commit comments