I want to execute tap() only when i get the first emitted value
Something like:
Observable
.pipe(
tap(() => { /* execute only when I get th
(Updating my earlier incorrect answer)
Based on cartant's comment and link provided, he has already done the work to create an operator that does this, it is in the 'rxjs-etc' package. A solution based on his operator is to install 'rxjs-etc', then:
import { initial } from 'rxjs-etc/operators';
observable$.pipe(
initial(src$ => src$.pipe(tap(() => {/* execute only on first value */})))
).
subscribe(() => {
// .....
})
Working StackBlitz example.