title: How to get current value of State object with @ngrx/store?
body: <p>My service class, before calling a web service, needs to get a property called <code>dataForUpdate</code> from my state. Currently, I'm doing it like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>constructor(public _store: Store &lt; AppState &gt; ,
    public _APIService: APIService) {
  
    const store$ = this._store.select('StateReducer');
  
    .../...
  
    let update = this.actions$.filter(action =&gt; action.type == UPDATE)
      .do((action) =&gt; this._store.dispatch({
        type: REDUCER_UPDATING,
        payload: action.payload
      })) **
      * GET STATE ** *= =&gt; .mergeMap(action =&gt; store$.map((state: AppState) =&gt; state.dataForUpdate).distinctUntilChanged(),
        (action, dataForUpdate) {
          return {
            type: action.type,
            payload: {
              employee: action.payload,
              dataForUpdate: dataForUpdate
            }
          };
        }) *
      AND CALL API *= =&gt; .mergeMap(action =&gt; this._APIService.updateEmployee(action.payload.employee, action.payload.dataForUpdate),
        (action, APIResult) =&gt; {
          return {
            type: REDUCER_UPDATED
          }
        })
      .share();
  
  
    .../...
  
    let all = Observable.merge(update, ....);
    all.subscribe((action: Action) =&gt; this._store.dispatch(action));
  
  }
  </code></pre>
  
  
  
  <p>I'm using angular2-store-example (<a href="https://github.com/ngrx/angular2-store-example/blob/master/src/app/users/models/users.ts" rel="noreferrer">https://github.com/ngrx/angular2-store-example/blob/master/src/app/users/models/users.ts</a>) as a guide to follow.</p>
  
  <p>I'm wondering if a better (cleaner) way exists?</p>
  
  <p>Live example: <a href="https://plnkr.co/edit/WRPfMzPolQsYNGzBUS1g?p=preview" rel="noreferrer">https://plnkr.co/edit/WRPfMzPolQsYNGzBUS1g?p=preview</a></p>