I\'m building a site with ES6 and Babel.
In a script file, I need to make an ajax call to a service on server. For that I\'m doing like this:
fetch(\
You need to add the 'isomorphic-fetch' module to your 'package.json' and then import this.
npm install --save isomorphic-fetch es6-promise
Then in your code
import "isomorphic-fetch"
See https://www.npmjs.com/package/isomorphic-fetch
Babel-polyfill (http://babeljs.io/#polyfill) currently doesn't include fetch in the polyfill. I was thinking of adding it though.
But yeah can use https://github.com/github/fetch