1
I’m doing an introduction to Redux with angular 4, and when I was doing a @Effect() I came across the following question:
@Effect()
private newUser = this.actions$
.ofType(UserActions.NEW_USER)
.map((action: UserActions.NewUser) => action.payload)
.switchMap((userData: UserCreation) => {
const headers = new HttpHeaders().set('Content-Type', 'application/json');
return this.http.post<User>(this.urlService.postNewUserUrl(), userData, { headers, observe: 'body' });
})
.map(user => {
return {type: AuthActions.TRY_SIGNIN, payload: -->{email: userData.email, userData.password}}<--
});
How can I access the issued value of the first . map() to be used by the following operators? In this case I want to use what was returned to switchMap() through the first map().