code: function toPromise(PromiseCtor) {
      var _this = this;
      if (!PromiseCtor) {
          if (root.root.Rx && root.root.Rx.config && root.root.Rx.config.Promise) {
              PromiseCtor = root.root.Rx.config.Promise;
          }
          else if (root.root.Promise) {
              PromiseCtor = root.root.Promise;
          }
      }
      if (!PromiseCtor) {
          throw new Error('no Promise impl found');
      }
      return new PromiseCtor(function (resolve, reject) {
          var value;
          _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
      });
  }
docs: /* tslint:disable:max-line-length 
  @param PromiseCtor
  @return {Promise<T>}
  @method toPromise
  @owner Observable