I am trying to make sequential http calls but the next function (i.e. getGroups
) is not called.
These are my function signatures:
getTokenForGroups() : Observable<any>
getGroups() : Observable<any> // is not called
I've checked getTokenForGroups
gets called, but my second function isn't.
let grps = []
this.getTokenForGroups().pipe(
concatMap(tokenResult => {
console.log(tokenResult);
return this.getGroups(userId, tokenResult.token)
}),
tap(res => console.log("tap2, group result", res)),
).subscribe(groups => {
grps = groups.value as string[];
console.log(grps)
}, error => {
console.log(error);
});