Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
how to start executing code if one code is already executed
db.collection('users_donors').doc('users').collection('usersList').where('userType', '==', 'users').get().then(doc => {
  setupUI(user);
});

db.collection('users_donors').doc('donors').collection('donorsList').where('userType', '==', 'donors').get().then(doc => {
  setupUIDonor(user);
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you want to make the second database call run after the first one completes, you can do:

db.collection('users_donors').doc('users').collection('usersList').where('userType', '==', 'users').get().then(doc => {
  setupUI(user); 
  db.collection('users_donors').doc('donors').collection('donorsList').where('userType', '==', 'donors').get().then(doc => {
    setupUIDonor(user);
  });
});

Of, if you're willing to use more modern JavaScript, you can use async/await:

let doc = await db.collection('users_donors').doc('users').collection('usersList').where('userType', '==', 'users').get();
setupUI(user);
 
doc = await db.collection('users_donors').doc('donors').collection('donorsList').where('userType', '==', 'donors').get();
setupUIDonor(user);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!