repeaterjs / repeater

The missing constructor for creating safe async iterators
https://repeater.js.org
MIT License
459 stars 12 forks source link

Implement async generator combination functions similar to the ones from rx.js #4

Closed brainkim closed 5 years ago

brainkim commented 5 years ago

Channel.race calls Promise.race on each iteration, Channel.merge merges all async iterators into a single iterator, Channel.zip calls Promise.all on each iteration, and Channel.latest returns an iterator which iterates with the latest values when any individual iterator updates.

brainkim commented 5 years ago

Implemented in commits: c6acfbbcdd88a50adba456dacccb2e8905c2a2d7 3e741f0a99e911d3cde79440d75666d123d278ee 10cbbc9984a4ee25e2c18384438ddf33d6ecec51

TODO: fix the type parameters for these methods. 0e4b770ec3bafeda69136b4029726b18cff39460

brainkim commented 5 years ago

TODO: Rename Channel.all to Channel.zip because all implies that all iterators are run to completion when in actuality the iterator returns when any child iterators return. d8bb3a54c6ca88d46c7b805670575643696d1506

brainkim commented 5 years ago

Released in 1.0