1.6.0 • Published 9 years ago

@f/map-gen v1.6.0

Weekly downloads
12
License
MIT
Repository
github
Last release
9 years ago

map-gen

Build status Git tag NPM version Code style

Map for generator.

Installation

$ npm install @f/map-gen

Usage

var map = require('@f/map-gen')

Array.from(map(addOne, function * () {
  yield 1
  yield 2
  yield 3
})) // [2, 3, 4]

function addOne(v) {
  return v + 1
}

API

mapGen(fn, gen)

  • fn - mapping function
  • gen - generates values to map

Returns: generator of mapped values

License

MIT