Skip to content

Latest commit

 

History

History
215 lines (127 loc) · 5.52 KB

File metadata and controls

215 lines (127 loc) · 5.52 KB

ReactFire reference docs / firestore

Module: firestore

Table of contents

Functions

Functions

preloadFirestoreDoc

preloadFirestoreDoc(refProvider): Promise<SuspenseSubject<DocumentSnapshot<DocumentData>>>

Preload a subscription to a Firestore document reference.

Use this to warm up useFirestoreDoc for a specific document

Parameters

Name Type
refProvider () => Promise<DocumentReference>

Returns

Promise<SuspenseSubject<DocumentSnapshot<DocumentData>>>

Defined in

src/firestore.tsx:28


useFirestoreCollection

useFirestoreCollection<T>(query, options?): ObservableStatus<QuerySnapshot<T>>

Subscribe to a Firestore collection

Type parameters

Name Type
T DocumentData

Parameters

Name Type
query FirestoreQuery<T>
options? ReactFireOptions<T[]>

Returns

ObservableStatus<QuerySnapshot<T>>

Defined in

src/firestore.tsx:86


useFirestoreCollectionData

useFirestoreCollectionData<T>(query, options?): ObservableStatus<T[]>

Subscribe to a Firestore collection and unwrap the snapshot into an array.

Type parameters

Name Type
T DocumentData

Parameters

Name Type
query FirestoreQuery<T>
options? ReactFireOptions<T[]>

Returns

ObservableStatus<T[]>

Defined in

src/firestore.tsx:96


useFirestoreDoc

useFirestoreDoc<T>(ref, options?): ObservableStatus<DocumentSnapshot<T>>

Suscribe to Firestore Document changes

You can preload data for this hook by calling preloadFirestoreDoc

Type parameters

Name Type
T DocumentData

Parameters

Name Type
ref DocumentReference<T>
options? ReactFireOptions<T>

Returns

ObservableStatus<DocumentSnapshot<T>>

Defined in

src/firestore.tsx:42


useFirestoreDocData

useFirestoreDocData<T>(ref, options?): ObservableStatus<T>

Suscribe to Firestore Document changes and unwrap the document into a plain object

Type parameters

Name Type
T unknown

Parameters

Name Type
ref DocumentReference<T>
options? ReactFireOptions<T>

Returns

ObservableStatus<T>

Defined in

src/firestore.tsx:62


useFirestoreDocDataOnce

useFirestoreDocDataOnce<T>(ref, options?): ObservableStatus<T>

Get a Firestore document, unwrap the document into a plain object, and don't subscribe to changes

Type parameters

Name Type
T unknown

Parameters

Name Type
ref DocumentReference<T>
options? ReactFireOptions<T>

Returns

ObservableStatus<T>

Defined in

src/firestore.tsx:74


useFirestoreDocOnce

useFirestoreDocOnce<T>(ref, options?): ObservableStatus<DocumentSnapshot<T>>

Get a firestore document and don't subscribe to changes

Type parameters

Name Type
T DocumentData

Parameters

Name Type
ref DocumentReference<T>
options? ReactFireOptions<T>

Returns

ObservableStatus<DocumentSnapshot<T>>

Defined in

src/firestore.tsx:52