title: rxJS and ngrx - what is the right structure of success / fail inside an effect?
body: <p>I work in angular 2 Project and use ngrx and rxjs technologies.</p>
  
  <p>Now I have a problem:</p>
  
  <p>I try to declare an Effect. 
  The effect has http request, and <strong>only when it success</strong> I want to call other http-request, and so <strong>only if it also success</strong> - then dispatch an success-action.</p>
  
  <p>I has tested it by throw an error but it always dispatch the action!</p>
  
  <p>See:</p>
  
  <pre><code>       @Effect()
  createEntity$ = this.actions$.ofType(CREATE_ENTITY)
      .switchMap((action: CreateEntity) =&gt; {
  
          return this.httpService.getDefaultEntityData(action.payload.type).map((entity) =&gt; {
              return  Observable.throw("testing only");
              /*if (entity) {
                   entity.title = entity.type;
                   return this.httpService.addEntity(entity);
              }*/
          })
  
              .catch((error) =&gt; Observable.of(new createEntityFailure(error)))
              .map(mappedResponse =&gt; ({ type: CREATE_ENTITY_SUCCESS, payload: mappedResponse }))
      });
  </code></pre>