fetch.js.flow 597 B

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