Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
It's 'just' an API call right?
Or are you looking for something that examines the data ... manages the state in a more complex manner or something? -
hack64614yAxios is decent one but plain fetch is actually all you need. We are using custom util function built on top fetch. Its about 100 lines and contains things like url normalization, different domains for different environments, error handling, json parsing etc. We never had any problem with it
-
@devphobe if it works, remember to publish the package if for no other reason than to further muddy the waters for 2022.
-
@HiFiWiFiSciFi I hate the proliferation of packages. For this project I’ve already copied the twenty lines of code out of thousands that would have been brought in with npm. I could publish my own minimal package, but this is crucial to our app security , and the risk of upstream poisoning here seems too great.
-
@devphobe
You certainly don't need a package to fetch something or build your own a wrapper around it do some minimal checks and so forth.
And yet some rando package almost sounds like what you were asking for ;)
What’s 2020s way of consuming a REST API in React? Too many options!
rant