In my application I need some data to be loaded inside the VueX store before routing starts (for example user sessions).
An example of a race condition would be the following:
// In routes definition
{
name: 'login',
path: '/login',
component: Login,
meta: {
goToIndexIf: () => store.getters['auth/loggedIn']
}
}
In this situation the route guard might be executed before the user had been received from the server.
Using conditional rendering did not help as the route guards are executed with or without a <router-view v-if="storeReady">
within the rendered template.
How can I make all my routing wait on some asynchronous data?