Last active
February 7, 2018 12:06
-
-
Save kaueDM/5798e9c4f5d398e906a262cce7ab7bc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Promise.all(PromiseStack) | |
.then(() => { | |
console.log('Data sent to Firestore') | |
let taskList = {} | |
// isEmpty(taskList) ? Promise.resolve('vazio') : Promise.reject('cheio') | |
db.collection('tasks') | |
.where('user', '==', userUID) | |
.where('active', '==', true) | |
.where('completed', '==', false) | |
.get() | |
.then(tasks => { | |
tasks.forEach(task => taskList[task.data().uid] = task.data()) | |
Promise.resolve(taskList) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment