title: How to dispatch multiple actions from ngrx 7 effects
body: <p>The idea is to listen for one action to trigger this effect and then make a service call that returns data. When the service call has been successful, I want to dispatch two different actions. I have tried many different combinations that I found on SO, but none of them work - only the first action gets dispatch, completely ignoring the second one. Tried this with <code>switchMap</code>, <code>mergeMap</code> but still only the first action gets dispatched.</p>
  
  <pre><code>@Effect()
      getAllShows$ = this.actions$
      .pipe(
          ofType(GetAllShowsAction.GET_ALL_SHOWS),
          switchMap((action: any) =&gt; this.showService.getAllShows(action.payload).pipe(
              mergeMap( response =&gt; { return [new GetAllShowsAction(action.payload + 1), new GetAllShowsSuccessAction(response)] },
              catchError( error =&gt; of(new GetAllShowsErrorAction()))
              )
          )
  ));
  </code></pre>
  
  <p>My app information:</p>
  
  <pre><code>Angular CLI: 7.3.6
  Node: 10.10.0
  OS: darwin x64
  Angular: 7.2.10
  ... animations, common, compiler, compiler-cli, core, forms
  ... language-service, platform-browser, platform-browser-dynamic
  ... router
  
  Package                           Version
  -----------------------------------------------------------
  @angular-devkit/architect         0.13.6
  @angular-devkit/build-angular     0.13.6
  @angular-devkit/build-optimizer   0.13.6
  @angular-devkit/build-webpack     0.13.6
  @angular-devkit/core              7.3.6
  @angular-devkit/schematics        7.3.6
  @angular/cli                      7.3.6
  @angular/fire                     5.1.2
  @ngtools/webpack                  7.3.6
  @schematics/angular               7.3.6
  @schematics/update                0.13.6
  rxjs                              6.4.0
  typescript                        3.2.4
  webpack                           4.29.0
  </code></pre>
  
  <p>NgRx version 7.3.0.</p>