Share via

Single Page Application - Reusing

Rajarajacholan Krishnamurthy 31 Reputation points
2020-05-15T10:57:49.317+00:00

I have a single page application with a dashboard. The dashboard has several components and each component is calling a service. As the number of components in the dashboard is getting increased, the number of service calls also increase and I see this hits the performance. I am thinking of making just one call to the service and bundle everything inside the service. Several components in the dashboard almost share the same data in different forms. Would appreciate ideas and suggestions.

Thanks indeed.

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 23,605 Reputation points
    2023-08-27T02:53:53.8733333+00:00

    Instead of making individual service calls for each component, design your server-side API to handle requests for aggregated data. This way, you can fetch all the necessary data in a single request.

    Depending on your backend technology (REST API, GraphQL, etc.), you can create custom endpoints or queries that retrieve the required data for different components.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.