let fruit = {
id: 1,
isGood: false
}
lets say I have a function call that accepts an id of a fruit object and returns an observable that resolves into a boolean indicating whether the value isGood is true or false.
I want to map through an array of fruit objects and call the function described above then use the value returned to set isGood on an object and set an id from the fruit on the same object that is returned.
In my mind, I should be able to do something like this:
forkJoin(
fruitArray.map(fruit => {
return of({
"data": isFruitGood(fruit.id)),
"id": fruid.id
})
})
).subscribe(result => console.log(result))
The problem here is that an array of objects is returned, but the observable set to data in the object is not resolving.