Как и в заголовке, нужно ли использовать .then внутри функции async / await. Какой эффективный путь между двумя
setPersonList = async ()=> {
const personList = [];
await this.firestoreCollection
.get()
.then(result => {
personList = { ...result.data };
});
return personList ;
};
или
setPersonList = async () => {
const personList = [];
const snapshot = await this.firestoreCollection
.get()
snapshot.docs.forEach((doc) => {
personList .push(doc.data());
});
return personList ;
};