rx-to-iterall

    1.0.2 • Public • Published

    rx-to-iterall Build Status

    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

    Install

    npm i rx-to-iterall

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    27 kB

    Total Files

    7

    Last publish

    Collaborators

    • tjmehta