title: Is there an RxJS operator similar to withLatestFrom but with a parameter?
body: <p>My Angular 5 application is based on <a href="https://ngrx.github.io/" rel="noreferrer">NgRx</a>, a state management library similar to Redux but based on RxJS.</p>
  
  <p>I often need to get the latest value from the store based on the payload of the current action.</p>
  
  <p>In RxJS terminology, it means that I have my main stream that constantly produce items and for each new item I need to create a side stream based on the item's value, get the latest value from this stream, and combine it with the main stream.</p>
  
  <p>At the moment, I do something like this:</p>
  
  <pre><code>@Effect()
  public moveCursor$: Observable&lt;Action&gt; = this.actions$.pipe(
    ofType&lt;TableAction.MoveCursor&gt;(TableActionType.MOVE_CURSOR),
    switchMap(action =&gt; this.store$.select(selectTableById(action.payload.cursor.tableId)).pipe(
      first(),
      map(table =&gt; ({action, table}))
    )),
    map(({action, table}) =&gt; {
      ...
    })
  )
  </code></pre>
  
  <p>I know it is probably not the best solution and I am looking for something like this (which is not possible with <code>withLatestFrom</code> operator):</p>
  
  <pre><code>@Effect()
  public moveCursor$: Observable&lt;Action&gt; = this.actions$.pipe(
    ofType&lt;TableAction.MoveCursor&gt;(TableActionType.MOVE_CURSOR),
    withLatestFrom(action =&gt; this.store$.select(selectTableById(action.payload.cursor.tableId))),
    map(([action, table]) =&gt; {
      ...
    })
  )
  </code></pre>
  
  <p>So my question is: Is there any RxJS operator which is similar to <code>withLatestFrom</code> which can take a value produced by the first stream as a parameter?</p>