fetch.js 570 B

12345678910111213141516
  1. /**
  2. * Copyright (c) 2013-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. */
  8. 'use strict'; // This hopefully supports the React Native case, which is already bringing along
  9. // its own fetch polyfill. That should exist on `global`. If that doesn't exist
  10. // then we'll try to polyfill, which might not work correctly in all environments.
  11. if (global.fetch) {
  12. module.exports = global.fetch.bind(global);
  13. } else {
  14. module.exports = require("isomorphic-fetch");
  15. }