【发布时间】:2019-07-29 08:42:31
【问题描述】:
我自己解释一下:
我想要做的是将 async/await 与其中一个库(异步或蓝鸟)一起使用。
我不明白为什么这很好用:
const promises = Promise.map (someArray, async item => {
const result = await getSomething(item);
return {...item, ...result}
});
const promisesResults = await Promise.all(promises);
但是 async.map 不是这样。它返回给我undefined。
谢谢大家!
【问题讨论】:
-
但与 async.map 不同。 - 它不可能相同,因为它是不同的库。你到底在尝试什么代码?
-
const promises = async.map (someArray, async item => { const result = await getSomething(item); return {...item, ...interview} });
标签: javascript node.js async-await bluebird async.js