Created
May 12, 2017 08:03
-
-
Save anteburazer/d896f7cd79a0c20948a20c3915cfe544 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() | |
doLogin$: Observable<Action> = this.actions$ | |
.ofType(actions.ActionTypes.DO_LOGIN) | |
.map((action: actions.DoLoginAction) => action.payload) | |
.switchMap(state => { | |
return this.authApiClient.login(state) | |
.map(user => new actions.DoLoginSuccessAction(new User(user))) | |
.catch(error => of(new actions.DoLoginFailAction())); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment