Keeping firebase login stats with vuejs

If you use vuejs and firebase building the app, you can use vuex to control state, somehow, you don’t want to do this. the problem is freshing but browser don’t know what’s your state? you don’t have cookie or session ever, you can use firebase api onAuthStateChanged.

// main.js
let app;
firebase.auth().onAuthStateChanged(function(user) {
// you can also handle user...
// if doesn't exist, it set a new vue instance.
if (!app) {
app = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
}
});