fetch.js 572 B

12345678910111213141516171819
  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';
  9. // This hopefully supports the React Native case, which is already bringing along
  10. // its own fetch polyfill. That should exist on `global`. If that doesn't exist
  11. // then we'll try to polyfill, which might not work correctly in all environments.
  12. if (global.fetch) {
  13. module.exports = global.fetch.bind(global);
  14. } else {
  15. module.exports = require('isomorphic-fetch');
  16. }