flyd-mergeall

0.1.0 • Public • Published

flyd-mergeAll

Build Status

mergeAll implementation for flyd streams.

It flattens an Stream-of-streams, emitting each time any of the emitted streams emit a value. The parameter concurrency can be added to specify how many streams will be emitting at same time. For instance, if concurrency is 1, the first stream will have to end in order for the second one to emit on the result stream.

([Number] HighOrder-Stream) -> Stream Example without specifying concurrency (all can emit):

a:           {--.-----.--.---.----------.--------}
               [1]   [4 5 6 7 8]      [1 2]
                        [2 4]
                            [3 5 7]
mergeAll(a): {--1-----4-5264738577-----1-2------}

Example with concurrency 1:

 
a:                 {--.-----.--.---.----------.--------}
                     [1]   [4 5 6 7 8]       [1 2]
                              [2 4]
                                  [3 5 7]
mergeAll(1, a):    {--1-----4-5-6-7-8--7------1-2------}
 

Usage

 
 
 

Package Sidebar

Install

npm i flyd-mergeall

Weekly Downloads

3

Version

0.1.0

License

MIT

Last publish

Collaborators

  • bertofer