My current setup involves making a simple Axios call in this way:
.get('https://myAPI.com/')
.then(response => {
this.info = response.data
})
Subsequently, I utilize a v-for array loop on my components to display the retrieved data. However, the issue arises from repeatedly running this mounted Axios call on every component where it is used.
For instance, one of my components for desktop screens employs this axios call to showcase data in a sidebar, while another component for mobile screens also uses the exact same axios call for displaying information in a header.
The dilemma lies in the fact that multiple calls are being made to the same API due to each component implementing the mounted axios function separately.
Is there a strategy available to execute this call just once and then apply the v-for loop on each individual component?