title: Route After Action Completes - NGRX and Angular
body: <p>Angular 5 and NGRX 5</p>
  
  <p>I am attempting to run some custom validation after a users clicks a search button, and if the validation is successful, route to a new page. </p>
  
  <p>I have an isError observable that is being populated from my store:</p>
  
  <pre><code> isError$: Observable&lt;boolean&gt;;
  
    ngOnInit() {
      this.isError$ = this.store$.select(
        ShipmentLookupStoreSelectors.selectShipmentLookupError
      );
    } 
  </code></pre>
  
  <p>I am calling the search action on my store as below:</p>
  
  <pre><code>  onSearch() {
     this.store$.dispatch(new ShipmentLookupStoreActions.Search());
    }
  </code></pre>
  
  <p>What I am confused with is how/when to actually route to the new page? What I essentially want to happen is:</p>
  
  <p>run validation</p>
  
  <p>if success -> route to new page</p>
  
  <p>if failure -> stay on same page with updated state (isError state will be updated to true, I have this working)</p>
  
  <p>I've looked into ngrx router-store but am overall confused as the best way to implement this.</p>