Using useDocument in a pinia store #1422
-
I am trying to use the useDocument from VueFire in a pinia store in composition API and I have tried different ways but none are working. I am using the following: export const useAllProfileStore = defineStore('allProfiles', () => { async function getAllProfiles() { return { Main page /* imports */ /* Const */ watch(()=>oneDoc,()=>{console.log(oneDoc.value); async function initTable() { Just trying to get the data, having it in a realtime and be able to share it accross different components. !!!!My problem is that I will need to assign the pending state to the pinia ref oneDocLoading.!!!! I really tried so many different variations but none are working... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Like other composables you must call them within injectable contexts. In the case of pinia stores, this means at the root level of the function. |
Beta Was this translation helpful? Give feedback.
Like other composables you must call them within injectable contexts. In the case of pinia stores, this means at the root level of the function.