Closed seanaguinaga closed 6 months ago
In two different components, the same document is subscribed to
export function DisplayName() { const db = useFirestore(); const ref = useRef<HTMLButtonElement | null>(null); const [status, setStatus] = useState<'loading' | 'sucess' | 'error' | 'idle'>('idle'); const { user, profile, updateProfile } = useUser(); const { data } = useFirestoreDocData(doc(db, `profiles/${user.uid}`), { idField: 'id', });
export function Username() { const db = useFirestore(); const ref = useRef<HTMLButtonElement | null>(null); const [status, setStatus] = useState<'loading' | 'sucess' | 'error' | 'idle'>('idle'); const { user, profile, updateProfile } = useUser(); const { data } = useFirestoreDocData(doc(db, `profiles/${user.uid}`), { idField: 'id', });
Will this open two subscriptions or just open one and share the data via the observable cache?
I am asking because useFirestoreDocDataOnce does not seem to share local updates between components
In two different components, the same document is subscribed to
Will this open two subscriptions or just open one and share the data via the observable cache?