I'm studying the promises with Nodejs. I've a question about a situation with two nested Q.all.
Q.all(promises1)
.then(function(res1) {
var promises2 = <METHOD THAT USE THE RES1>
Q.all(promises2)
.then(function(re2) {
...
})
})
The problem is that I need the result of the first Q.all for the second. The promises1 are multiple save function, and I need the objectId of the item saved in the multiple function that I use in the promises2. I'am studying the promises for not having nested function, my question is how can I resolve this nest?