I have an observable stream. The first operator is a mergeMap that returns an array of observables. I then have to have a second mergeMap to get the final values from the first mergeMap's return. I feel this second mergeMap should be unnecessary, but cannot find a way around it.
Example:
source$.pipe(
mergeMap(() => [of(1), of(2), of(3)]),
mergeMap((val) => val)
)
This is ultimately what I have. The second mergeMap only exists to subscribe to the output of the first. Without it, my output is the observable (i.e. of(1)
instead of the actual value 1). Is there a way around having this second mergeMap?