Closed sethp closed 4 years ago
A question I had is whether it would make more sense to throw the type error straightaway rather than defer it until promise resolution time?
A question I had is whether it would make more sense to throw the type error straightaway rather than defer it until promise resolution time?
Yes. That's better. Can you update the tests?
Else, passing in an invalid concurrency (in my case, because I wanted to see if
-1
meant "unlimited") produces a confusing error message: both alimit is not a function
at the point of use, and anUnhandledPromiseRejectionWarning
from node itself.An example: