Skip to content

Instantly share code, notes, and snippets.

@bleeckerj
Created January 18, 2017 06:12
Show Gist options
  • Select an option

  • Save bleeckerj/b595383f301c87075a3747991d8af323 to your computer and use it in GitHub Desktop.

Select an option

Save bleeckerj/b595383f301c87075a3747991d8af323 to your computer and use it in GitHub Desktop.
<script src="https://unpkg.com/@reactivex/rxjs@5.0.0-beta.7/dist/global/Rx.umd.js"></script>
<script src="https://fb.me/react-with-addons-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.compat.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var source = Rx.Observable
.range(1, 3);
var s2 = Rx.Observable
.range(5, 5)
.delay(
Rx.Observable.timer(300),
function (x) { return Rx.Observable.timer(x * 400); }
)
.timeInterval()
.map(function (x) { return x.value; });
var s3 = Rx.Observable.concat(source, s2);
var subscription = s3.subscribe(
function (x) {
console.log(`Next: `+x);
},
function (err) {
console.log('Error: '+ err);
},
function () {
console.log('Completed');
});
</script>
<script id="jsbin-source-javascript" type="text/javascript">var source = Rx.Observable
.range(1, 3);
var s2 = Rx.Observable
.range(5, 5)
.delay(
Rx.Observable.timer(300),
function (x) { return Rx.Observable.timer(x * 400); }
)
.timeInterval()
.map(function (x) { return x.value; });
var s3 = Rx.Observable.concat(source, s2);
var subscription = s3.subscribe(
function (x) {
console.log(`Next: `+x);
},
function (err) {
console.log('Error: '+ err);
},
function () {
console.log('Completed');
});</script></body>
</html>
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment