DEV Community

tj4000
tj4000

Posted on

How to make a grouping of all API call

Goal:
Create a api.js for grouping all api call into a single file.

Problem:
If you have many webpages with many api calls, how should you create a group of all api call into a single file?
Do you have a sample?

Stackblitz:
https://stackblitz.com/edit/react-pvb5w2

Info:
*Angular has a grouping of all call by using service but I don't know if it possibly to create the same approach for react js. Do you have a sample?
*I'm newbie in reactjs.

Thank you!

Top comments (0)