Created
October 26, 2016 15:29
-
-
Save anonymous/4f0a08c56e4912e7250b99bbe9231017 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/xomiwekiqe
This file contains 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 characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.umd.js"></script> | |
<script id="jsbin-javascript"> | |
'use strict'; | |
var source1 = Rx.Observable.range(0, 5); | |
var source2 = Rx.Observable.from([0, 1, 2, 3, 4]); | |
var selectorFn = function selectorFn(source1, source2) { | |
return { | |
source1: source1, | |
source2: source2 | |
}; | |
}; | |
var source = Rx.Observable.zip(source1, source2, selectorFn); | |
var subscription = source.subscribe(console.log, console.error, function () { | |
return console.log('complete!'); | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">let source1 = Rx.Observable.range(0, 5); | |
let source2 = Rx.Observable.from([0,1,2,3,4]); | |
let selectorFn = (source1, source2) => ({ | |
source1, | |
source2 | |
}); | |
var source = Rx.Observable.zip(source1, source2, selectorFn); | |
var subscription = source.subscribe(console.log, console.error, () => console.log('complete!'));</script></body> | |
</html> |
This file contains 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 characters
'use strict'; | |
var source1 = Rx.Observable.range(0, 5); | |
var source2 = Rx.Observable.from([0, 1, 2, 3, 4]); | |
var selectorFn = function selectorFn(source1, source2) { | |
return { | |
source1: source1, | |
source2: source2 | |
}; | |
}; | |
var source = Rx.Observable.zip(source1, source2, selectorFn); | |
var subscription = source.subscribe(console.log, console.error, function () { | |
return console.log('complete!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment