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);
});
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);