A .find() .then(fucntion(a){ console.log(a) return B.find() }) .then(function(b){ console.log(a); })
比如这样的代码,怎样能在第二个then中获取a的值
A .find() .then(fucntion(a){ console.log(a) return B.find() }) .then(function(b){ console.log(a); })
比如这样的代码,怎样能在第二个then中获取a的值
A.find B.find 都没有直接的联系,干嘛不用并行?Promise.all
var _a;
A
.find()
.then(fucntion(a){
_a =a
console.log(a)
return B.find()
})
.then(function(b){
console.log(a);
})