Skip to content

Changing arguments order #7

@nfroidure

Description

@nfroidure

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions