Skip to content

Instantly share code, notes, and snippets.

@praveenpuglia
Last active April 25, 2018 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save praveenpuglia/c52313e76a41e89debdaf8161fd1f3be to your computer and use it in GitHub Desktop.
Save praveenpuglia/c52313e76a41e89debdaf8161fd1f3be to your computer and use it in GitHub Desktop.
Do not dispatch an action from an ngrx effect
@Effect({ dispatch: false })
logout$: Observable<Action> = this.actions$.pipe(
ofType(UserActionTypes.LOGOUT),
tap(action => {
delete window.localStorage.user;
this.router.navigate(['login']);
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment