co-reduce

1.0.1 • Public • Published

co-reduce Build Status

Reduce an array (or object), using generators.

Install

Install the package with npm:

$ npm install co-reduce

Usage

reduce(array, fn, init)

co(function* () {
  var sum = yield* reduce([1, 2, 3, 4], function* (s, n) {
    return yield* asyncAdd(s, n);
  }, 0);
  console.log(sum);
});

License

MIT

Package Sidebar

Install

npm i co-reduce

Weekly Downloads

10

Version

1.0.1

License

MIT

Last publish

Collaborators

  • lennon