In my current setup, I have the following observables:
this.authenticationService.isSignedIn() -> Observable<Boolean>
this.user$ -> Observable<UserModel>
I am in need of checking a condition based on both these observables, so I attempted the following approach:
zip(this.authenticationService.isSignedIn(), this.user$).pipe(
map(([isSignedIn, user]: [boolean, UserModel]) => isSignedIn && user.claims))
);
However, the result I received was unexpected. To further investigate the issue, I utilized the following method:
zip(this.authenticationService.isSignedIn(), this.user$).pipe(
tap(([isSignedIn, user]: [boolean, UserModel]) => {
console.log(isSignedIn);
console.log(user);
})
);
Surprisingly, the console.log
statements did not execute as expected. What could be the possible explanation for this behavior?