title: How to do if/else in ngrx/effects?
body: <p>I am using ngrx/effects. I want to dispatch different actions based on a <code>foo</code> state in the store.</p>
  
  <p>This is how I am doing now:</p>
  
  <pre><code> @Effect() foo1$ = this.updates$
      .whenAction(Actions.FOO)
      .filter(obj =&gt; !obj.state.product.foo)
      .map&lt;string&gt;(toPayload)
      .map(x =&gt; ({ type: Actions.BAR1, payload: { x }}));
  
    @Effect() foo2$ = this.updates$
      .whenAction(Actions.FOO)
      .filter(obj =&gt; obj.state.product.foo)
      .map&lt;string&gt;(toPayload)
      .map(x =&gt; ({ type: Actions.BAR2, payload: { x }}));
  </code></pre>
  
  <p>Is there a way to use RxJS 5 operators like <code>partition</code>, <code>groupBy</code>, <code>if</code>, <code>case</code> in <a href="https://stackoverflow.com/questions/32594357/rxjs-modeling-if-else-control-structures-with-observables-operators">this post</a>? I cannot use it correctly now.</p>