Listening to multiple observable streams
In this recipe, we’ll work with the combineLatest
operator to listen to multiple observable streams at once. Using this operator results in having an array as an output, combining all the streams. This approach is appropriate for when you want the latest output from all the streams, combined in a single subscription.
Getting ready
The app that we are going to work with resides in start/apps/chapter05/rx-multiple-streams
inside the cloned repository:
- Open the code repository in your code editor.
- Open the terminal, navigate to the code repository directory, and run the following command to serve the project:
npm run serve rx-multiple-streams
This should open the app in a new browser tab, and you should see the following:
Figure 5.2: The rx-multiple-streams app running on http://localhost:4200
Now that we have the app running locally, let’s see the steps of the recipe...