Hello. I am trying to do something as follows:
I have a function that returns an observable that emits an array of items, and then with each of these items I want to make an additional request based on a property in said thing that also returns an observable, then combine the two items and subscribe to the result (sorry if this explanation is a little confusing, I'd be happy to elaborate)
here is what ive tried so far but to no avail:
this.gameService
.fetchGames()
.pipe(
switchMap((ret: any) => ret.map((game: any) => this.userService.getUserById(game.hostId)))
)
.subscribe((e) => {
console.log("result:", e);
});