Using combineLatest to subscribe to multiple streams together
In the previous recipe, we had to merge all the streams, which resulted in a single output being last emitted by any of the streams. In this recipe, we'll work with combineLatest
, which 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 subscribe.
Getting ready
The project that we are going to work with resides in chapter05/start_here/using-combinelatest-operator
, inside the cloned repository.
- Open the project in VS Code.
- Open the Terminal and run
npm install
to install the dependencies of the project. - Once done, run
ng serve -o
.This should open the app in a new browser tab, and you should see something like this:
Now that we have the app running locally...