sindresorhus / p-map

Map over promises concurrently
MIT License
1.27k stars 58 forks source link

Should be able to get resolved values when stopOnError=false #29

Closed wholenews closed 3 years ago

wholenews commented 3 years ago

Should be able to get both resolved values, and aggregate error, like in p-settle. I'm looking for the combination of p-settle and p-map which seems not to exist...

With p-settle (even when supplying function) it's called immediately. In my case this starts all the requests at once.

With p-map it throttles the requests according to concurrency but there is no way to get the resolved results if any request fails.

sindresorhus commented 3 years ago

The concurrency option in p-settle should work: https://github.com/sindresorhus/p-settle/blob/071020fc6cd7884e74228d546943f53cbc3ca28c/test.js#L31 And if not, that's a bug.

You could also use https://github.com/sindresorhus/p-reflect with p-map.

wholenews commented 3 years ago

Ah, you're right p-settle does work as intended. I must have misinterpreted the data. Thanks for a quick response!