Created
March 8, 2017 18:56
-
-
Save impankratov/93e559d625b5a1291fc72585bec3b9fd to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/peyuden
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script> | |
<script src="http://cdn.jsdelivr.net/rsvp/3.0.6/rsvp.js"></script> | |
<script id="jsbin-javascript"> | |
'use strict'; | |
var first = Rx.Observable.interval(1000); | |
var second = Rx.Observable.interval(1000); | |
second['do'](function (val) { | |
return console.log('Service: ', val); | |
}).subscribe(); | |
Rx.Observable.combineLatest(first, second)['do'](function (val) { | |
return console.log('Method: ', val); | |
}).first().subscribe(); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"><\/script> | |
<script src="//cdn.jsdelivr.net/rsvp/3.0.6/rsvp.js"><\/script> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
const first = Rx.Observable.interval(1000) | |
const second = Rx.Observable.interval(1000) | |
second | |
.do(val => console.log('Service: ', val)) | |
.subscribe() | |
Rx.Observable.combineLatest(first, second) | |
.do(val => console.log('Method: ', val)) | |
.first() | |
.subscribe()</script></body> | |
</html> |
This file contains hidden or 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
'use strict'; | |
var first = Rx.Observable.interval(1000); | |
var second = Rx.Observable.interval(1000); | |
second['do'](function (val) { | |
return console.log('Service: ', val); | |
}).subscribe(); | |
Rx.Observable.combineLatest(first, second)['do'](function (val) { | |
return console.log('Method: ', val); | |
}).first().subscribe(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment