Skip to content

Instantly share code, notes, and snippets.

@ahgood
Created May 14, 2016 07:19
Show Gist options
  • Select an option

  • Save ahgood/bd522bacea86a23d0f2dd0cb6514586c to your computer and use it in GitHub Desktop.

Select an option

Save ahgood/bd522bacea86a23d0f2dd0cb6514586c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
"use strict";
console.clear();
var streamA = Rx.Observable.of(3, 4, 1);
console.log(JSON.stringify(streamA.array.map(function (b) {
return b + 1;
})));
var streamB = streamA.map(function (a) {
return 10 * a;
});
streamB.subscribe(function (a) {
return console.log(a);
});
</script>
<script id="jsbin-source-javascript" type="text/javascript">console.clear()
var streamA = Rx.Observable.of(3, 4, 1)
console.log(JSON.stringify(streamA.array.map(b => b + 1)))
var streamB = streamA.map(a => 10 * a)
streamB.subscribe(a => console.log(a))</script></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment