title: Angular2 ngrx/store with route parameters
body: <p>I'm updating an app to use ngrx/store, but I can't figure out how to make it work with route parameters.</p>
  
  <p>Currently, I am just using <code>ActivatedRoute</code> and using <code>this.route.params</code> inside the <code>ngOnInit()</code> of my components. So something like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>ngOnInit(): void {
     this.route.params
        .switchMap((params: Params) =&gt; {
          return this.item_service.get(params['item_id'])
        })
        .subscribe((item) =&gt; {
          this.item = item;
        });
  }
  </code></pre>
  
  <p>Now that I'm using ngrx/store, I need to use an observable for the store. Basically I am trying to accomplish something like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>this.item = this.store.select('item').filter((item: Item) =&gt; {
      return item.id == magically_obtained_params['item_id'];
  });
  </code></pre>
  
  <p>Is there a way to make this work?</p>
  
  <hr>
  
  <p>Update (2016/12/06):</p>
  
  <p>I added <a href="https://stackoverflow.com/a/41008754/1316229">an answer</a> to expand on <a href="https://stackoverflow.com/a/40968285/1316229">FunStuff's answer</a>, since it didn't fully provide what I want. I haven't accepted either answer, as I think there is likely a better way to deal with this.</p>
  
  <p>To clarify my question, I am trying to make this work in a way that <code>this.item</code> is an <code>Observable</code>.</p>