'use strict';

const Rx = require('rx');
require('isomorphic-fetch');

Rx.config.longStackSupport = true;

module.exports = function (url, options) {

  return Rx.Observable.fromPromise(fetch(url, options))
    .flatMapLatest((response) => {

      return Rx.Observable.fromPromise(response.text())
        .map((body) => {

          return {
            url: response.url,
            status: response.status,
            statusText: response.statusText,
            headers: response.headers,
            text: body,
            size: response.size, // ???
            ok: response.ok,
            timeout: response.timeout
          };

        });

    });

}

'use strict';

const Rx = require('rx');
require('isomorphic-fetch');

module.exports = function (url, options) {

  return Rx.Observable.fromPromise(fetch(url, options))
    .flatMapLatest((response) => {

      return Rx.Observable.fromPromise(response.text())
        .map((body) => {

          return {
            url: response.url,
            status: response.status,
            statusText: response.statusText,
            headers: response.headers,
            text: body,
            size: response.size, // ???
            ok: response.ok,
            timeout: response.timeout
          };

        });

    });

}

Remove Rx.config.longStackSupport flag, which was left in unintentionally.
Remove Rx.config.longStackSupport flag, which was left in unintentionally.

Fixes #1.
