@f/map-gen

1.6.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @f/map-gen

Weekly Downloads

5

Version

1.6.0

License

MIT

Last publish

Collaborators

  • f