JSFiddle - React, Tailwind, and code Playground

by Asko Kauppi

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.0/rx.lite.js"></script>
<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<pre>
Would like to see:
AB: 0a
AB: 1a
</pre>

JavaScript

var A= new Rx.Subject();
var B= new Rx.Subject();
    
//A.subscribe( function (v) { console.log( "A: "+ v ); } );
A.onNext(0);    

// '.combineLatest' needs all the dependency Observables to get emitted, before 
//  its combined signal is emitted.
//
// How to have a combined signal emitted when any of the dependencies change
// (using earlier given values for the rest)?
//    
A.combineLatest( B, function (a,b) { return a+b; } )
 .subscribe( function (v) { console.log( "AB: "+ v ); } );

B.onNext("a");  
A.onNext(1);