Skip to content

Instantly share code, notes, and snippets.

@chungchi300
Created April 3, 2017 04:00
Show Gist options
  • Select an option

  • Save chungchi300/fcf91508e444e24203d490a658ec8f47 to your computer and use it in GitHub Desktop.

Select an option

Save chungchi300/fcf91508e444e24203d490a658ec8f47 to your computer and use it in GitHub Desktop.
// the whatwg-fetch polyfill installs the fetch() function
// on the global object (window or self)
//
// Return that as the export for use in Webpack, Browserify etc.
require('whatwg-fetch');
var globalObject = typeof self === "undefined" ? global : self;
module.exports = globalObject.fetch.bind(globalObject);
// the whatwg-fetch polyfill installs the fetch() function
// on the global object (window or self)
//
// Return that as the export for use in Webpack, Browserify etc.
require('whatwg-fetch');
var globalObject = typeof self === "undefined" ? global : self;
module.exports = globalObject.fetch.bind(globalObject);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment