Last active
August 31, 2020 09:05
-
-
Save ZeevKatz/a7f8dd93f17d7f72b4b327a0cbdef57e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly onChanges$$ = new Subject(); | |
private readonly onChanges$ = this.onChanges$$.pipe(); | |
ngOnChanges({ events }: SimpleChanges) { | |
this.onChanges$$.next(); | |
if (events) { | |
this.registerEvents(this.events) | |
.pipe( | |
takeUntil(this.onChanges$), | |
untilDestroyed(this) | |
) | |
.subscribe(event => this.logEvent(event, this.properties)); | |
} | |
} | |
ngOnDestroy() { | |
this.onChanges$$.complete(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment