如果我有这样的东西
return this.retrieveArticles(blogId).then(function(response){
return response.articles;
}).then(_).call("findWhere", match).then(function(article){
return {
"article": article
}
});
我决定把上面的部分砍掉
return response.articles;
}).then(_).call("findWhere", match).then(function(article){
return {
"article": article
}
});
我该怎么做
Promise.return(articles).then(_).call("findWhere", match).then(function(article){
return {
"article": article
}
});
最佳答案
Promise.resolve(_(articles)).call("findWhere", match);
或
Promise.resolve(articles).then(_).call("findWhere", match);
关于javascript - 如何构造返回常量字符串的 Bluebird Promise?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27563850/