-
-
Save adamtysonsmith/165a8367dfef68e04dd0c538dc987f1f 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/rxjs@5.0.0-beta.7/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!'); | |
}); |
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
Rx.Oberservable.zip with selector |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment