質問

I need to make map with async functions like async.map async library.
Is there a way to make it with Q.js?

役に立ちましたか?

解決

By the power of Q combined with the inherent power of Array…

return Q.all(values.map(function (value) {
    return getPromise(value);
}));

This will return a promise for an array of results.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top