
Reactive Patterns with RxJS for Angular
By :

You should think of everything as a stream. This is the golden rule.
We have recipes$
, which is our data stream. What if we were to consider the click on the See results button as a stream as well? We don't know when, but every time the user clicks on See results, the action stream emits the value of the filter.
In total, we have the data stream (responsible for getting the data) and the action stream (responsible for emitting the latest value of the filter). Both of the streams rely on each other; when recipes$
emits a new value, the filter should stay active, and when the filter emits a new value, the recipes list should be updated accordingly.
What we are really trying to do is get information from different streams. And whenever you want to join information from multiple observables, you should think of one of the combination operators available in RxJS.
Instead of getting the data we need from both streams...