pheuter / essential-react

A minimal skeleton for building testable React apps using Babel
MIT License
2.02k stars 131 forks source link

Use fetch #9

Closed nkt closed 9 years ago

nkt commented 9 years ago

Maybe you should replace /common/request.js by fetch? https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent There is polyfill: https://github.com/github/fetch

pheuter commented 9 years ago

Seems like window.fetch is a nicer way to do xhr with promises out of the box. I think devs who would like to implement this in their apps can easily include it as a dependency, but in the interest of depending on as few libraries as possible and keeping the skeleton minimal, I think it is fine to leave the basic XMLHttpRequest implementation in /common/request.js.