title: Handling successful action dispatch in component
body: <p>I have a component with a form that adds items to a list. After successfully adding an item to the list, I want to use <code>form.resetForm();</code>, but I can't figure out a simple way to know when that action was successful. I was hoping I could subscribe to the action dispatch, but haven't been able to figure that out. </p>
  
  <p>I've tried several approaches I've found online, but they all seem to be outdated. I did get it to work by adding a <code>saving</code> property to my store and subscribing to that, but that seemed like an excessive amount of work for something that should be pretty simple. </p>
  
  <p>Is there a way to just subscribe to something inside my component or container without refactoring my NGRX logic?</p>
  
  <p>Here is the code in my container that adds the item to the list:</p>
  
  <pre><code>addPosition(position: Position) {
    this.store.dispatch(new fromStore.CreatePosition(position));
  }
  </code></pre>
  
  <p><strong>Action:</strong></p>
  
  <pre><code>export const CREATE_POSITION = '[Profile] Create Position';
  export const CREATE_POSITION_FAIL = '[Profile] Create Position Fail';
  export const CREATE_POSITION_SUCCESS = '[Profile] Create Position Success';
  
  export class CreatePositionSuccess implements Action {
    readonly type = CREATE_POSITION_SUCCESS;
    constructor(public payload: any) {}
  }
  </code></pre>
  
  <p><strong>Effect:</strong></p>
  
  <pre><code>@Effect()
      createPosition$ = this.actions$.pipe(
          ofType(positionsActions.CREATE_POSITION),
          map((action: positionsActions.CreatePosition) =&gt; action.payload),
          switchMap(position =&gt; {
              return this.positionService
                  .addPosition(position)
                  .pipe(
                      map(newPosition =&gt; new positionsActions.CreatePositionSuccess(newPosition)),
                      catchError(error =&gt; of(new positionsActions.CreatePositionFail(error)))
                  );
          })
      );
  </code></pre>
  
  <p>I'm on version 7 of ngrx and 6.3 of rxjs.</p>