Would be nice to change the arguments order in order to put the collection at the end. This would allow the following usage:
import batchPromises from 'batch-promises';
Promise.resolve([1, 2, 3, 4, 5])
.then(batchPromises.bind(null, function() { }, 4));
Note i also put the Iteratee as the first argument since we also could want to set the batch size dynamically:
import batchPromises from 'batch-promises';
Promise.all([
4,
[1, 2, 3, 4, 5]
])
.spread(batchPromises.bind(null, function() { }));
It could be an occasion to publish a 1.0.0 version and embrace semver at the same time ;).
Let me know if you want me to do a PR according to those changes.
Would be nice to change the arguments order in order to put the collection at the end. This would allow the following usage:
Note i also put the Iteratee as the first argument since we also could want to set the batch size dynamically:
It could be an occasion to publish a 1.0.0 version and embrace semver at the same time ;).
Let me know if you want me to do a PR according to those changes.