Skip to content

Instantly share code, notes, and snippets.

@alx-andru
Created November 1, 2018 13:29
Show Gist options
  • Save alx-andru/07176c271987e65ebd975af7c300894e to your computer and use it in GitHub Desktop.
Save alx-andru/07176c271987e65ebd975af7c300894e to your computer and use it in GitHub Desktop.
@Effect()
loadUser$: Observable<Action> = this.actions$.pipe(
ofType(UserActionTypes.USER_GET_ME, OidcActions.OidcActionTypes.UserFound),
switchMap(() =>
this.userService.getMe().pipe(
first(),
map((user: User) => {
return new GetUserMeSuccess(user);
}),
catchError(error => {
console.error(error);
return of(new GetUserMeError(error));
})
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment