rbuchmeier / nordicNumbers

0 stars 0 forks source link

Why use Axios instead of Fetch API? #73

Closed schillingjerrid closed 4 years ago

schillingjerrid commented 6 years ago

This is more of a question than an issue, but I noticed in the AppComponent.jsx we are using the Axios library. import axios from 'axios';

Is there a real benefit to loading a library to do this when we already have XMLHttpRequest (or Javascript's Fetch API if you need the Promise functionality)?

I see that Axios supports Promises and Automatic JSON transform but so does Fetch. And I understand Axios can be used in Node but Node has the HTTP module in the standard library. It doesn't support Promises but you can easily create a Promise.

More of a conversation piece than anything as what we have currently seems to be working just fine. I'm just working through bits of the code to understand it better and will likely ask many questions as I go along.