I'm looking to make several sequential requests to a server. I need each of the requests to start as the previous request completes and then, once all of them have completed, emit the values as an array.
I've tried using zip and forkJoin, but these subscribe to all the observables in parallel. concat is almost there, but it emits as each of the observables completes, whereas I need it to hold off emitting until all observables have completed and then emit all the values as an array.
use toArray operator is simplier
concat(
of(1),
of(4),
of(7)
).pipe(toArray())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With