Skip to content

Instantly share code, notes, and snippets.

@yuizho
Forked from anonymous/index.html
Created August 14, 2016 11:52
Show Gist options
  • Save yuizho/833420abfff3766ce399d035808c2c6a to your computer and use it in GitHub Desktop.
Save yuizho/833420abfff3766ce399d035808c2c6a to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/nepoja
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.1.0/rx.lite.js"></script>
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
'use strict';
var subject = new Rx.Subject();
subject.subscribe(function (n) {
return console.log(n);
}, null, function () {
return console.log('completed');
});
subject.onNext(1);
subject.onNext(2);
subject.onCompleted();
</script>
<script id="jsbin-source-javascript" type="text/javascript">var subject = new Rx.Subject();
subject.subscribe(
(n) => console.log(n),
null,
() => console.log('completed')
);
subject.onNext(1);
subject.onNext(2);
subject.onCompleted();</script></body>
</html>
'use strict';
var subject = new Rx.Subject();
subject.subscribe(function (n) {
return console.log(n);
}, null, function () {
return console.log('completed');
});
subject.onNext(1);
subject.onNext(2);
subject.onCompleted();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment