-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Milestone
Description
Instead of having three functions
each(arr, iterator, [callback])
eachSeries(arr, iterator, [callback])
eachLimit(arr, limit, iterator, [callback])
How about just having each take an optional object argument at the end
each(arr, iterator[, options][, callback])
To run series have options be {series: true}
To run with limit have options be {limit: 2}
The series option could even be removed as its equivalent to {limit: 1}
I think this would help simplify the library as the number of functions will be reduced but the power will still be there and additional options can easily be added.
This could be done as a non-breaking change as eachSeries and eachLimit are deprecated and each is extended to support the optional options argument.