Stop being the product.
Become the owner.
or
sign uplog in
A copy-paste fetch() wrapper, plus information on replicating Axios-like features

I'm of the belief that if you can get what you need with under ~100 lines of code (and it doesn't require highly-specialized skills to write it), then write it yourself, don't install a third party library.

If you don't share a similar belief, then this page isn't for you, and that's ok.

For everyone else, this page shares a fetch wrapper function you can copy-paste into your projects to add in a couple of missing features, and provides some tips on how you can replicate some of the most loved Axios features using `fetch()`.

Most alternative fetch wrappers I find online tend to be small NPM libraries (I'd rather maintain the code myself thank you), or they like creating separate methods for .get(), .post(), .put(), etc (which makes it unnecessarily difficult to "decorate" it with interceptor-like behaviors, as this page discusses), or there may be other design problems. Those alternatives are still good starting points, but I'm hoping this could be a little more complete of a guide to jump start your usage of `fetch()`.

And I have a thing about make copy-paste alternatives to tools, and this was a hole in my collection :).

Feedback is welcome.

#programming #technology #dev #js
source
loved
1
laughed
1
shocked
1
sad
1
angry
1
not impressed
1
Confusing about how to improve coding capbility effectively?

Actually, I am a cyber-secuirty researcher, but in the past few years in university, I always participate in many competition like CTF(Capture The Flag). In this term, I just know how to observe and test the vulnerable challenges which are designed deliberately and attack it to get flags.

However, from that point, I can't impove my coding skills instead of writing some Poc or Exp. So I am concerned about it. I have some foundation about program, but I haven't ability to construct a whole system like a website or a app. Meanwhile, I don't know how to find a good project to learn how to coding.

I will appreciate it if your guys could give me some suggestion about it!

Good Wish!
#technology #dev #programming
source
loved
1
laughed
1
shocked
1
sad
1
angry
1
not impressed
1