Overview
Often I need to do a switchMap but persist the emitted value. Maybe dispatch an action to the store, but need the observable to wait until dispatching is finished.
of("example").pipe(
switchTapFirst(value => service.dispatch(value))
).subscribe(value => console.log(value));
The above switches to the inner observable, discards the first emitted value and then emits the original value. It acts like tapping the observable but waiting.