mesqueeb / vuex-easy-firestore

Easy coupling of firestore and a vuex module. 2-way sync with 0 boilerplate!
https://mesqueeb.github.io/vuex-easy-firestore
MIT License
234 stars 28 forks source link

Example of error page would be helpful #334

Closed adamb closed 4 years ago

adamb commented 4 years ago

In the setup you mention:

It's very important that we take the user to an error page when something went wrong with the Firestore initialisation.

But it's not clear how to open an error page from inside the init. A hint or example would be helpful.

I tried making an error page but can't access the router from inside the ~store/index.js:initFirebase() function.

louisameline commented 4 years ago

Hi, technically, only the persistence option of the store may fail:

firebase.app.firestore().enablePersistence().catch(error => {})

After that, it's the requests to the store that fail, hang or succeed. It's up to you to display a spinner or something until you have the data, or an error message if your get request failed. We can't tell you how to design your app, it depends on your needs. I hope it makes things a bit clearer.