Skip to content

LuKks/merge-iterators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

merge-iterators

Merge iterators into one

npm i merge-iterators

Usage

const mergeIterators = require('merge-iterators')

const it = mergeIterators([
  (async function * () { yield 1 })(),
  (function * () { yield 2 })(),
  (async function * () { yield 3 })(),
  (function * () { yield 4 })()
])

for await (const value of it) {
  console.log(value) // 2, 4, 1, 3
}

License

MIT

About

Merge iterators into one

Resources

License

Stars

Watchers

Forks

Packages

No packages published