How to properly wait to VueFire to retrieving the data inside Pinia store before using it? #1537
Unanswered
obedi123
asked this question in
Questions and Help
Replies: 2 comments
-
You watch for the values to change. watch(placeStore.placeInfo, (new_value)=>{
favicon.href = new_value.placeFaviconUrl
}) https://vuejs.org/guide/essentials/watchers.html Or you introduce a promise you can await await placeStoreReady
favicon.href = placeStore.placeInfo?.placeFaviconUrl; |
Beta Was this translation helpful? Give feedback.
0 replies
-
But I agree that this is not optimal as I asked the same question. We really didn't need to create a worse await syntax with watch. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm having problems to change my website's title and favicon URL for the ones I bring from Firestore because the variables get assigned before the data is retrieved. The template render the data just fine when it arrives, but in the case of variables, apparently they don't get reassigned when the data loads eventually.
Store:
Component:
So, my question is what's the right way to wait for data to load before assigning the value to the variables?
Beta Was this translation helpful? Give feedback.
All reactions