I have an rxjs-Observable which I subscribe to. I now have two different necessities to handle within the pipe of the Observable.
First I want to map the output. Second I want to use tap to trigger a side-effect, but the side-effect must not be triggered on the first emission.
So this obviously does not work, because the skip is working globally on the pipe:
this.userChangeSubscription = this.userStateService.userState$
.pipe(
map(userState => userState.prop),
skip(1),
tap(() => this.sideEffect())
)
.subscribe();
Is there any way to do this, without subscribing to the Observable twice?
edit: Ok, I now have several options that all seem to be working. Now: which one to choose?