I have two components on the same page. The first one displays a list of item while the second one is a refiner for the displayed items. I'd like to use Observables in a service in order to establish a "communication" between the two components.
So, in my mind, it would be something like:
- The first component subscribes to the observable and, in the same time, retrieves the unfiltered list of items.
- When the user clicks a refining criteria in the second component, a service function is called to emit something on the
Observableand therefore, the first component receives a new list of item and update its view.
It seems simple but I can't wrap my head around the different classes (Subscription, Subscriber, Subject and Observable). The closest I've been was by using Subject but I have no idea how to send the initial list of items when there is a new subscriber.