Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created November 21, 2011 21:26
Show Gist options
  • Save ElemarJR/1383995 to your computer and use it in GitHub Desktop.
Save ElemarJR/1383995 to your computer and use it in GitHub Desktop.
<!DOCTYPE>
<html>
<head>
<title>Simple RX</title>
</head>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="rx.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var observable = Rx.Observable.Range(0, 10);
var observer = observable.Subscribe(
function (e) { document.write("onNext: " + e + "<br/>"); }, /* onNext */
function (e) { document.write("onNext: " + e + "<br/>"); }, /* onError */
function () { document.write("OnCompleted") } /* onCompleted */
);
observer.Dispose();
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment