polyfills.js 613 B

123456789101112131415
  1. if (typeof Promise === 'undefined') {
  2. // Rejection tracking prevents a common issue where React gets into an
  3. // inconsistent state due to an error, but it gets swallowed by a Promise,
  4. // and the user has no idea what causes React's erratic future behavior.
  5. require('promise/lib/rejection-tracking').enable();
  6. window.Promise = require('promise/lib/es6-extensions.js');
  7. }
  8. // fetch() polyfill for making API calls.
  9. require('whatwg-fetch');
  10. // Object.assign() is commonly used with React.
  11. // It will use the native implementation if it's present and isn't buggy.
  12. Object.assign = require('object-assign');