Created
November 1, 2018 13:29
-
-
Save alx-andru/07176c271987e65ebd975af7c300894e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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