If I have
const data = [
{
a: "string1",
b: "string2"
}
{
a: "string1",
b: "string2"
},
{
a: "string1",
b: "string2"
}
]
Now I want to map on the data to the function functionThatReturnsAPromiseOfArrays: Promise<any[]>:
data.map(d => {
d.b = functionThatReturnsAPromiseOfArrays(d.b)
return d;
});
How can I get a promise of the entire data array?
I can't use Promise.all directly on the array since the objects in data are not Promises.