ReactFire reference docs / firestore
- preloadFirestoreDoc
- useFirestoreCollection
- useFirestoreCollectionData
- useFirestoreDoc
- useFirestoreDocData
- useFirestoreDocDataOnce
- useFirestoreDocOnce
▸ preloadFirestoreDoc(refProvider): Promise<SuspenseSubject<DocumentSnapshot<DocumentData>>>
Preload a subscription to a Firestore document reference.
Use this to warm up useFirestoreDoc for a specific document
| Name | Type |
|---|---|
refProvider |
() => Promise<DocumentReference> |
Promise<SuspenseSubject<DocumentSnapshot<DocumentData>>>
▸ useFirestoreCollection<T>(query, options?): ObservableStatus<QuerySnapshot<T>>
Subscribe to a Firestore collection
| Name | Type |
|---|---|
T |
DocumentData |
| Name | Type |
|---|---|
query |
FirestoreQuery<T> |
options? |
ReactFireOptions<T[]> |
ObservableStatus<QuerySnapshot<T>>
▸ useFirestoreCollectionData<T>(query, options?): ObservableStatus<T[]>
Subscribe to a Firestore collection and unwrap the snapshot into an array.
| Name | Type |
|---|---|
T |
DocumentData |
| Name | Type |
|---|---|
query |
FirestoreQuery<T> |
options? |
ReactFireOptions<T[]> |
ObservableStatus<T[]>
▸ useFirestoreDoc<T>(ref, options?): ObservableStatus<DocumentSnapshot<T>>
Suscribe to Firestore Document changes
You can preload data for this hook by calling preloadFirestoreDoc
| Name | Type |
|---|---|
T |
DocumentData |
| Name | Type |
|---|---|
ref |
DocumentReference<T> |
options? |
ReactFireOptions<T> |
ObservableStatus<DocumentSnapshot<T>>
▸ useFirestoreDocData<T>(ref, options?): ObservableStatus<T>
Suscribe to Firestore Document changes and unwrap the document into a plain object
| Name | Type |
|---|---|
T |
unknown |
| Name | Type |
|---|---|
ref |
DocumentReference<T> |
options? |
ReactFireOptions<T> |
▸ useFirestoreDocDataOnce<T>(ref, options?): ObservableStatus<T>
Get a Firestore document, unwrap the document into a plain object, and don't subscribe to changes
| Name | Type |
|---|---|
T |
unknown |
| Name | Type |
|---|---|
ref |
DocumentReference<T> |
options? |
ReactFireOptions<T> |
▸ useFirestoreDocOnce<T>(ref, options?): ObservableStatus<DocumentSnapshot<T>>
Get a firestore document and don't subscribe to changes
| Name | Type |
|---|---|
T |
DocumentData |
| Name | Type |
|---|---|
ref |
DocumentReference<T> |
options? |
ReactFireOptions<T> |
ObservableStatus<DocumentSnapshot<T>>