JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/Reactive-Extensions/RxJS/master/dist/rx.all.js"></script>
JavaScript
var source = Rx.Observable.range(0, 5)
.concatMap(function (x, i) {
return Rx.Observable
.interval(100)
.take(x).map(function() { return i; });
});
var subscription = source.subscribe(
x => console.log(`onNext:`, x),
e => console.log(`onError:`, e),
() => console.log(`onCompleted`)
)
subscription.dispose();