Skip to content

Instantly share code, notes, and snippets.

@ZeevKatz
Last active August 31, 2020 09:29
Show Gist options
  • Save ZeevKatz/402658b6e4dd273c2341acc21fd8a17d to your computer and use it in GitHub Desktop.
Save ZeevKatz/402658b6e4dd273c2341acc21fd8a17d to your computer and use it in GitHub Desktop.
@Rehooktive(Hook.OnChanges)
private readonly onChanges$: Observable<SimpleChanges>;
ngOnChanges({ events }: SimpleChanges) {
if (events) {
this.registerEvents(this.events)
.pipe(takeUntil(this.onChanges$))
.subscribe(event => this.logEvent(event, this.properties));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment