Is there a way to test if a lazy loaded page has already been loaded?

#1

My entire PWA app is lazy loaded, and consists of over 20 pages… When users first load the app, it takes longer to load than I’d like, but I can live with that…

First, it’s a tabs app, with 5 tabs, each page being lazy-loaded. What’s happening is that the tabs are shown, and usually the home page loads fairly quickly (it’s setup with priority “high”), and the rest of the pages are priority “low”. However, most new users want to go to the profile page almost immediately. On a slow connection, the Profile page hooked to the “Profile” tab won’t be loaded yet, and for the user, the app appears to freeze.

Is there a way to know the “profile” page or any other page is loaded, so I can show a loading spinner if it’s not loaded yet?