I'm making an introduction to redux with angle 4, and when I was doing an @ 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 emitted value of the first .map () to be able to use in the following operators? In this case I want to use what was returned to switchMap () through the first map ().