I am learning RxJS
. I have 3 api call's, I need to make 2nd api call, and pass it's data as a parameter to 3rd api call. I tried this:
checkPermission(permissionName: string): Observable<boolean> {
this.check(this.p1)
.pipe(
switchMap(res => {
const shouldCheck = res.Value;
if (shouldCheck.toLowerCase() === 'true') {
return this.checkPermission(permissionName).pipe(
map(result => {
return result;
})
);
} else return of(true);
})
)
.subscribe(permission => {
});
}
But getting syntax error.