var sources = {
'foo': Rx.Observable.return(42),
'bar': Rx.Observable.return(56)
};
var defaultSource = Rx.Observable.empty();
var source = Rx.Observable.case(
function () {
return 'foo';
},
sources,
defaultSource);
var subscription = source.subscribe(
function (x) { console.log('Next: ' + x); },
function (err) { console.log('Error: ' + err); },
function () { console.log('Completed'); } );