0👍
You can init vue app just after onAuthStateChanged
first call.
// main.js
const unsubscribe = firebaseAuth.onAuthStateChanged(user => {
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
unsubscribe() // unsubscribe to call init function only once
}
})
- [Vuejs]-Properly written init method within module action
- [Vuejs]-Uncaught TypeError: [] is not a function
Source:stackexchange.com