Observable Data Store Service with different Data Sets In Angular2
<p>I'm trying to follow the "Observable data store" pattern in Angular 2 (detailed in this blog post from <a href="http://blog.angular-university.io/how-to-build-angular2-apps-using-rxjs-observable-data-services-pitfalls-to-avoid/" rel="nofollow noreferrer">Angular University</a>) From what I understand, this means that, if I have a service called <code>TodoStore,</code> I would subscribe to <code>TodoStore.items$</code> so I could get all the latest updates for my to-do list in real time (as other components add, remove, or edit <code>Todos</code>.</p>

<p>However, what if I have two components side-by-side that display different <code>Todo</code>lists, filtered on the server-side? One might display <code>Todo</code>s due today while another would show <code>Todo</code>s due on a user-selected date. </p>

<p>In this case, I would not be able to use the same <code>TodoStore</code>, as both would be fetching different data from the server. How do I handle sharing this service between these two components? My urge is to go back to an angular1-style <code>getToDoList()</code> service method, but then I'm storing state inside a single component and can't possibly share data between multiple components without making extra API calls.</p>