I am working by myself in a project, I am using Reactjs and Nodejs.
I am done with the Nodejs part, I already have the data I need from the DB, I already convert it into json and I am ready to send this data to the front end.
All I am doing is a GET request where the main tool for the front end is axios. This GET request is in order to display a simple list of dealers for a Casino Game.
What I need is a brief piece of code and explanation in order to understand what I am doing. I've been reading all the info but is not that easy for me to get it because I feel unable to adapt the examples in the docs to my code, sorry, I am just a Junior Developer.
This is basically the service part
import axios from 'axios';
const API_ENDPOINT = `${API_URL}/services`;
const GetDealers = {
axios.get(`${API_ENDPOINT}/get-dealers/get-dealers`)
.then(function(response) {
console.log('get-dealers', response);
})
};
export default GetDealers;
now, what I need to know is: what should I do in the actions and the stores part ?
That is what I am really trying to figure out. After knowing what to do with the Actions and Stores, in the component, should I call the action or the store?
Angular was so easy for me to learn, but it seems as if React is for someone with at least 2 years of experience on JavaScript. It's been hard for me to get it.