I want to retrieve something that is asynchronus inside my map function but I don't understand how. The seek data is taken from firestore.
The problem is that I can't use async and await to retrieve seek async.
This is the code:
public quizes: Observable<JobbyAndSeek[]> = responseQuizes.snapshotChanges().pipe(
map(actions => actions.map(a => {
const jobby = a.payload.doc.data() as Jobby;
const seek = this.userService.getUserById(this.seeker ? jobby.idJobber : jobby.idSeeker) as User;
const data = new JobbyAndSeek(jobby,seek);
const id = a.payload.doc.id;
return { id, ...data };
}))
);
});