title: How do i write an NgRx 8 Effect that triggers an action from a promise
body: <p>I am struggling to grasp NgRx Effects.</p>
  
  <p>Using the latest release, version 8, i have written the following effect which combines the observable with a promise and am struggling to grasp how to write it correctly.</p>
  
  <p>Is this guaranteed to catch all possible errors?</p>
  
  <pre><code>authLogin$ = createEffect(() =&gt; this.actions$.pipe(
      ofType(AuthActions.authLogin),
      switchMap(async(action) =&gt; {
        try {
          const userState = await this.loginService.login(action.username, action.password);
          return AuthActions.authSuccess(userState);
        }
        catch (error) {
          return AuthActions.authLoginError({
            error: error
          });
        }
      })
    ),{ resubscribeOnError: false });
  </code></pre>
  
  <p>I am also not clear on whether or not i should be using the last bit of this configuration: <code>{ resubscribeOnError: false }</code> Does this mean subsequent execution will create an entirely new observable?</p>
  
  <p>Is there a better approach?</p>