Skip to content

Instantly share code, notes, and snippets.

@ZenabKhan
Created December 18, 2017 23:42
Show Gist options
  • Save ZenabKhan/703600fc9ce9af54654b03cab097318e to your computer and use it in GitHub Desktop.
Save ZenabKhan/703600fc9ce9af54654b03cab097318e to your computer and use it in GitHub Desktop.
// source https://jsbin.com
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/5.5.5/Rx.js"></script>
</head>
<body>
<script id="jsbin-javascript">
// Creates an observable sequence of 5 integers, starting from 1
var source = Rx.Observable.range(1, 5);
// Prints out each item
var subscription = source.subscribe(
function (x) { console.log('onNext: ' + x); },
function (e) { console.log('onError:' + e); },
function () { console.log('onCompleted'); });
</script>
<script id="jsbin-source-javascript" type="text/javascript">// Creates an observable sequence of 5 integers, starting from 1
var source = Rx.Observable.range(1, 5);
// Prints out each item
var subscription = source.subscribe(
function (x) { console.log('onNext: ' + x); },
function (e) { console.log('onError:' + e); },
function () { console.log('onCompleted'); });</script></body>
</html>
// Creates an observable sequence of 5 integers, starting from 1
var source = Rx.Observable.range(1, 5);
// Prints out each item
var subscription = source.subscribe(
function (x) { console.log('onNext: ' + x); },
function (e) { console.log('onError:' + e); },
function () { console.log('onCompleted'); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment