DEV Community

Discussion on: You Don't Need Axios

Collapse
 
adaptive-shield-matrix profile image
Adaptive Shield Matrix

The top things I can think of:

  • there are many different ready-made adapter for axios, including rate limiting
  • you can provide defaults, base paths while instantiating axios
  • not having to async call json() (in comparison to fetch) to get the data
  • having shorthand methods for get/post/...

With the release of fetch this list got much shorter...
I think I'm slowly coming around to using fetch on the browser as well

Thread Thread
 
webjose profile image
José Pablo Ramírez Vargas

I see. I think the author (and I agree) is on the line of "90% of people don't need adapters, don't need base paths or have them covered elsewhere". I think that for 9 out of 10 developers, axios is 57kb of "nothing I need".

I imagine that the adapters are probably very handy, but are also probably very specific and catered for the minority, not the majority.

So yes, I think you are doing the right thing considering fetch() as the primary tool here. If you need interception of request or response, that's something that can be easily done in far less than 57kb.

Cheers!

Some comments have been hidden by the post's author - find out more