Last active
January 9, 2016 08:32
-
-
Save rfaisal/dd4e01f62f1052eb9443 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = Rx.Observable.create(function(observer) { | |
setInterval(function() { | |
var curA = Math.floor((Math.random() * 100) + 1); | |
console.log("Current value of a " + curA); | |
observer.onNext(curA); | |
}, 3000); | |
}); | |
var b = 0; | |
a.subscribe(function(val) { | |
b=val+1; | |
console.log("Current value of b " +b); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment