I’m building an single-page application. I have a main container that contains “pages”, and when the user ‘goes’ from one page to another, I hide the current page and show the target page.
Until the target page is displayed, I want to show a “loader” element (spinning wheel).
Since my workflow to hide current page and show target page relies on changing the value of a “page” variable, it seems that the loader, which itself has its own boolean variable for display, is pretty much instantly set to “true” and back to “false”. In other words it doesn’t have time to become visible.
Is there a way to check if the target page element is fully rendered before changing the loader element’s variable?
EDIT: I’ve added a 1000ms “Time delay” event in the workflow A) after the loader is shown, and B) before the loader is hidden again, but I’m still wondering if there’s a better way to do this.