Cooly – 06-37 Jan 7

await Promise.all(
comments.map((item) => {
firebase
.firestore()
.collection("users")
.doc(item.user)
.get()
.then((snap) => {
console.debug('a')
}
});
})
)
console.debug('b')
await Promise.all(
comments.map((item) => {
firebase
.firestore()
.collection("users")
.doc(item.user)
.get()
.then((snap) => {
console.debug('a')
}
});
})
)
console.debug('b')
how can i make 'a' print before 'b'?
S
ScriptyChris467d ago
You should await firebase chain call inside map
UU
Unknown User467d ago