Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top