Converts an existing observable sequence to an ES6 Compatible Promise.
promiseCtor
(Function
): The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
(Promise
): An ES6 compatible promise with the last value from the observable sequence.
var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
promise.then(console.log.bind(console));
// => 42
Rx.config.Promise = RSVP.Promise;
var promise = Rx.Observable.return(42).toPromise();
promise.then(console.log.bind(console));
// => 42