rx-to-iterall
v1.0.2
Published
Convert rxjs observables into iterall async iterators
Downloads
3
Maintainers
Readme
rx-to-iterall
Convert rxjs Observables into iterall AsyncIterators
Installation
npm i --save rx-to-iterall
Usage
Convert an rxjs Observable into an iterall AsyncIterator
const forAwaitEach = require('iterall').forAwaitEach
const Observable = require('rxjs').Observable
const rxjsToIterall = require('rx-to-iterall')
const observable = Observable.from([1, 2, 3])
const asyncIterator = rxjsToIterall(observable)
const results = []
await forAwaitEach(asyncIterator, (data) => {
results.push(data)
})
console.log(results) // [1, 2, 3] (observable values)
Extend ObservableAsyncIterator with custom behavior
const ObservableAsyncIterator = require('rx-to-iterall')
class FooAsyncIterator extends ObservableAsyncIterator {
// ...
}
License
MIT