标签:
Sometime, we migth just want to return a object which wrap into Observable. You can use ‘just‘ or ‘return‘.
var source = Rx.Observable.return(42); var subscription = source.subscribe( function (x) { console.log(‘Next: ‘ + x); }, function (err) { console.log(‘Error: ‘ + err); }, function () { console.log(‘Completed‘); }); // => Next: 42 // => Completed
标签:
原文地址:http://www.cnblogs.com/Answer1215/p/5769134.html