IxJS
IxJS copied to clipboard
Doc: Add Observable to ObservableAsyncIterable conversion to the examples.
IxJS version:
3.0.1
Code to reproduce:
Expected behavior:
Actual behavior:
Additional information:
From what I've seen one of the features of ix
is to be able to convert an existing Observable
to a FromObservableAsyncIterable
which can be used in for await
loop. This is done if we pass an observable to the from()
method.
e.g.
const Rx = require('rxjs');
const aiRx= require('ix/asynciterable');
const {from,delay,concatMap} = Rx;
const aiFrom = aiRx.from;
const someObservable = from(["first Value","second value","third vlaue","fourth value","fifth value"])
.pipe(concatMap((v)=>of(v).pipe(delay(Math.random()*1000)) ))
(async function() {
for await (let num of aiFrom(someObservable)) {
console.log(num);
}
})();
Shouldn't such an example be added to the doc, or is it not officially supported?
Great question. Did it get added?
@timcash Yes, I believe we have this tested here.