Let's say we have 2 observables.
const obs1 = timer(1000); const obs2 = of(1,2,3)
If I'd like to wait until obs1 completes I could obviously use concat operator.
obs1.pipe(concat(obs2)).subscribe(console.log);
or
concat(obs1, obs2).subscribe(console.log);
It would work fine (the order is preserved), but the '0' emitted from the first obs would still be logged. Is there a way to force certain subscriptions' order, but ignore emissions from the given observable? (e.g. only values from the last observable in 'chain' should be seen).
In this particular case I know how many values to expect, so I could simply use skip/takeLast, but I'm looking for a generic solution, which doesn't require me to know the amount of elements emitted from observables.