Created
April 3, 2016 19:16
-
-
Save anonymous/f68f72924bcb8932d4a17a9de880d3b3 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,63 @@ <!DOCTYPE html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> </head> <body> <div id="app"></div> <script id="jsbin-javascript"> 'use strict'; function main() { return Rx.Observable.timer(0, 1000) // .map(function (i) { return 'Seconds elapsed ' + i; }); } function DONEffect(text$) { text$.subscribe(function (text) { var container = document.querySelector('#app'); container.textContent = text; }); } function consoleLogEffect(msg$) { msg$.subscribe(function (msg) { return console.log(msg); }); } var sink = main(); DONEffect(sink); consoleLogEffect(sink); </script> <script id="jsbin-source-javascript" type="text/javascript">function main(){ return Rx.Observable.timer(0, 1000) // .map(i => `Seconds elapsed ${i}`); } function DONEffect(text$){ text$.subscribe(text => { const container = document.querySelector('#app'); container.textContent = text; }); } function consoleLogEffect(msg$){ msg$.subscribe(msg => console.log(msg)) } const sink = main(); DONEffect(sink); consoleLogEffect(sink); </script></body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ 'use strict'; function main() { return Rx.Observable.timer(0, 1000) // .map(function (i) { return 'Seconds elapsed ' + i; }); } function DONEffect(text$) { text$.subscribe(function (text) { var container = document.querySelector('#app'); container.textContent = text; }); } function consoleLogEffect(msg$) { msg$.subscribe(function (msg) { return console.log(msg); }); } var sink = main(); DONEffect(sink); consoleLogEffect(sink);