Combining Streams
So far, we have learned about the reactive pattern to fetch data as streams and have covered error-handling patterns. However, we have only explored the asynchronous data emitted from only one stream. What if we want to work with the asynchronous data emitted from different streams? Do you know how we can proceed?
Luckily, RxJS ships with one of the most powerful concepts: combining streams. Combining streams is the process of bringing together the emissions of multiple Observables in one stream. This allows you to explore multiple sources of asynchronous data as if they were a single stream. The main idea behind combining streams is manipulating asynchronous data in a more structured way.
This chapter revolves around a common use case, which is filtering data; we will resolve this by combining streams. We will start by explaining the filtering requirement, and then we will explore the imperative, classic pattern that can be used to implement this requirement...