skip to Main Content

Javascript array and variable not updating

Trying to update tatol and orders value but it isn't updating please help. let total = 0; let awaitingOrders = []; invoice.orders.map(async(order, i) =>{ await db.collection("orders") .doc(order.id).get().then(orderDoc => { total += orderDoc.data().total; awaitingOrder.push(order); } }).catch((error) => { console.log(error); }); console.log(total,…

VIEW QUESTION

Flutter Cloud Firestore withConverter error

I'm following the documentation here to use custom objects when reading and writing cloud firestore. Client class: class Client { String id; String name; String email; int contactNumber; Client({ required this.id, required this.name, required this.email, required this.contactNumber, }); factory Client.fromFirestore(…

VIEW QUESTION
Back To Top
Search