Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 684 Bytes

promise.md

File metadata and controls

13 lines (9 loc) · 684 Bytes

Sets the default Promise type to be used when the toPromise method is called. Note that the Promise implementation must conform to the ES6 specification. Some of those supported libraries are Q, RSVP, when.js among others. If not specified, this defaults to the native ES6 Promise, if available, else will throw an error.

Example

Rx.config.Promise = RSVP.Promise;

var p = Rx.Observable.just(1).toPromise()
  .then(value => console.log('Value: %s', s));
// => Value: 1