Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pull-stream/pull-flatmap

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pull-flatmap

flatmap for pull-streams

map an input to an array, but the items in those arrays become the stream. so you can use this module to make expanding or contracting streams.

taken from example on introduction to pull-streams

example

var pull = require('pull-stream')
pull(
  pull.values([1,2,3]),
  flatmap(function (n) {
    //return an array of n n's [2,2] or [3,3,3], etc
    return new Array(n).map(function () { return n })
  }),
  pull.collect(function (err, ary) {
    if(err) throw err
    console.log(ary)
  })
)

output:

[1, 2, 2, 3, 3, 3]

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.