(refProvider: () => Promise<DocumentReference>)
| 26 | * Use this to warm up `useFirestoreDoc` for a specific document |
| 27 | */ |
| 28 | export async function preloadFirestoreDoc(refProvider: () => Promise<DocumentReference>) { |
| 29 | const ref = await refProvider(); |
| 30 | return preloadObservable(doc(ref), getDocObservableId(ref)); |
| 31 | } |
| 32 | |
| 33 | function getDocObservableId(ref: DocumentReference) { |
| 34 | return `firestore:doc:${ref.firestore.app.name}:${ref.path}`; |
nothing calls this directly
no test coverage detected