Answer the question
In order to leave comments, you need to log in
How to understand that all requests have been processed on a specific page?
I want to display the text "loading" on all pages instead of the main content, while requests are in progress on a specific page. As soon as all requests have been processed and given at least some answer, display the main content. How to do it right? Not wrapping all requests in promise.all etc. Interested in a universal solution so that it is not necessary to climb into the code of each component.
Answer the question
In order to leave comments, you need to log in
Well, you need to look at what kind of requests, who makes these requests, what is the criterion for executing each request.
It seems that the easiest way is to make two blocks. The first says "Loading", the second - the main content. Initially - the first block is visible, the second is hidden. As soon as the state "all requests are completed" is reached - hide the first block, open the second.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question