Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
  <title>JS Bin</title>
  <script src="//cdn.jsdelivr.net/rsvp/3.0.6/rsvp.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/rxjs/2.2.28/rx.all.min.js"></script>
</head>
<body>
  <input id="input" type="text">
</body>
</html>
 
var xs = Rx.Observable.interval(100)
    .map(function (x) { return 'first' + x; });
var ys = Rx.Observable.interval(100)
    .map(function (x) { return 'second' + x; });
var source = xs
    .join(
        ys,
        function () { return Rx.Observable.timer(0); },
        function () { return Rx.Observable.timer(0); },
        function (x, y) { return x + y; }
    )
    .take(5);
var subscription = source.subscribe(
    function (x) {
        console.log('Next: ' + x);
    },
    function (err) {
        console.log('Error: ' + err);   
    },
    function () {
        console.log('Completed');   
    });
// => Next: first0second0 
// => Next: first1second1 
// => Next: first2second2 
// => Next: first3second3 
// => Next: first4second4 
// => Completed   
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x