Skip to content

Instantly share code, notes, and snippets.

@impankratov
Created March 8, 2017 18:56
Show Gist options
  • Save impankratov/93e559d625b5a1291fc72585bec3b9fd to your computer and use it in GitHub Desktop.
Save impankratov/93e559d625b5a1291fc72585bec3b9fd to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/peyuden
<!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>
'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