3 回答
TA贡献1829条经验 获得超9个赞
是这样吗?
是
有没有人考虑过以这种方式构建链的记忆问题?
Promise.eachthen
记忆消耗在承诺库之间会有所不同吗?
是的,非常重要。
TA贡献1827条经验 获得超9个赞
thencatchcatch
function foo() {
function doo() {
// always return a promise
if (/* more to do */) {
return doSomethingAsync().then(function(){
throw "next";
}).catch(function(err) {
if (err == "next") doo();
})
} else {
return Promise.resolve();
}
}
return doo(); // returns a promise}添加回答
举报
