I'm creating for the first time a Vue app with VueUse.
In my main.ts, I've this:
const firebaseConfig = {
//....
}
// Initialize Firebase
const app = initializeApp(firebaseConfig)
const db = getFirestore(app)
export const useTodos= createGlobalState(
() => useFirestore(collection(db, 'todos')),
)
So in my views, when I want to use my Todos, it works fine with the useTodos hook, but there is a lot of time where I need to access a very specific document(something like /collection/key-one/sub-collections/key-two/property ).
Typically, I would access this:
const someDocument = useFirestore(doc(db, 'collection', myKey, 'sub-collections', myKeyTwo))
console.log(someDocument.property)
But I don't have access to the db field. How can I retrieve it?