G
G
grabbee2021-08-19 13:19:42
JavaScript
grabbee, 2021-08-19 13:19:42

How to load related data?

There is no data in the server response in some places, there is only a URI of a link to this object

{name: "Alex", tags: ["/api/tags/1","/api/tags/2","/api/tags/3"]}

Now I'm thinking about how to correctly load this data using these links in order to substitute the received data instead of the URI. So does anyone actually do it? Maybe there are ready-made npm solutions?
vulcain.png

As I understand from this picture, it simply pushes the data on the links to the client so that he can get access to them faster. But how to handle them on the client itself? Wherever I need to show "/api/tags/*" I need to make a request for data to the server, and will the browser slip a preloaded response?

And in order to collect all the data in the original object, do I need to fence my own logic for collecting this data? Now I'm trying to bypass the source object in a loop and look for these URIs in it, asynchronously request data from the server and replace the URI with the received data.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question