Hi everyone,
The loading substate is quite handy, but I realized that it often leads to results I don’t want. For instance, let’s say I’m transitioning to a route called “events”.
My model hook needs to do a call to my API, so while it waits, I can show the loading route by showing a full spinner on the page.
However, once the page is loaded, I have several selects that will update the query params and, in turn, reload the data from the server. The bad thing is that the whole page re-enters into the loading substate, which is often not what I want because I loose all the visual context that was already loaded. While it makes sense the first time the user enter into the route, once it is loaded, I prefer to have a smaller spinner, only in a very specific part of the page that reload.
Is there a way to actually to force the loading substate to only appear on first time?
Thanks
EDIT : actually, it seems that the answer would be to use an “events” route without model hook, that only give the “general” layout, and an “events.index” that do the loading.