Skip to content

Instantly share code, notes, and snippets.

@ZeevKatz
Last active September 28, 2020 07:23
Show Gist options
  • Save ZeevKatz/461d2842a226927eba6404d87cb8f509 to your computer and use it in GitHub Desktop.
Save ZeevKatz/461d2842a226927eba6404d87cb8f509 to your computer and use it in GitHub Desktop.
@Rehooktive(Hook.OnChanges)
private readonly onChanges$: Observable<SimpleChanges>;
constructor() {
this.onChanges$
.pipe(
pluck('events'),
filter<SimpleChange>(Boolean),
switchMap(events => this.registerEvents(events.currentValue))
)
.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