DEV Community

loading...

Discussion on: Fetch VS Axios | Make Https Requests like a pro.

Collapse
insanenaman profile image
Naman Gupta

I want to add one thing to this awesome blog i.e, if you just doing basic API calls then it's worth to use Redaxios in place of Axios. It can save some bytes.

Collapse
hj profile image
Hemant Joshi Author

Yeah, that is a strong point to mention!

Saving bytes writing well-optimized code is a really good habit as a developer.

Collapse
johannchopin profile image
johannchopin

Not it is definitively not. Premature optimisation is a common bad practice for most of the developers.

Thread Thread
insanenaman profile image
Naman Gupta

Thanks for mentioning this and I got your point but I don't think so it's totally valid in this particular case. Handling API is the basic thing and in case of Redaxios, it has similar API like Axios. Its more like selecting a framework before starting the project. Many people choose React over full fledged framework like Angular and stuff just for the sake of decreasing build size. I do agree with the blog when it mentions like overthinking about compatibility with Docker, Kubernetes, etc but here the point is just a simple library for a simple task. Still we opt for build tools like webpack which can provide features like treeshaking right from the start 😉.

Thread Thread
johannchopin profile image
johannchopin

You're totally right 👍 I just answer for the part 'optimizing each bit of a code' which should avoided.

Thread Thread
insanenaman profile image
Naman Gupta

Bt thanks for mentioning. I didn't know about this and got something new to learn. Thanks @johannchopin