import { Subject } from 'rxjs' ; import { OnDestroy } from '@angular/core' ; import { Constructor } from './constructor' ; export interface ThyUnsubscribe extends OnDestroy { ngUnsubscribe$ : Subject < any > ; } /** Mixin to augment a directive with a `disableRipple` property. */ export function mixinUnsubscribe < T extends Constructor < { } > > ( base ) { return class Mixin extends base { ngUnsubscribe$ = new Subject ( ) ; constructor ( ... args ) { super ( ... args ) ; } ngUnsubscribeReinitialize ( ) { this . ngUnsubscribe$ . next ( ) ; this . ngUnsubscribe$ . complete ( ) ; this . ngUnsubscribe$ = new Subject ( ) ; } ngOnDestroy ( ) { this . ngUnsubscribe$ . next ( ) ; this . ngUnsubscribe$ . complete ( ) ; } } ; }