R
Reactiflux

help-js

Cooly – 06-37 Jan 7

CCooly1/7/2023
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'?
SScriptyChris1/7/2023
You should await firebase chain call inside map
UUUnknown User1/7/2023
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!