1.6.0 • Published 9 years ago
@f/map-gen v1.6.0
map-gen
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 functiongen
- generates values to map
Returns: generator of mapped values
License
MIT