Skip to content

Commit 8b56bb8

Browse files
Add documentation for the initialValue option
1 parent 910345c commit 8b56bb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

firestore/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ The `useCollectionData` hook takes the following parameters:
126126
- `snapshotListenOptions`: (optional) `firebase.firestore.SnapshotListenOptions` to customise how the collection is loaded
127127
- `snapshotOptions`: (optional) `firebase.firestore.SnapshotOptions` to customise how data is retrieved from snapshots
128128
- `transform`: (optional) a function that receives the raw `firebase.firestore.DocumentData` for each item in the collection to allow manual transformation of the data where required by the application. See [`Transforming data`](#transforming-data) below.
129+
- `initialValue`: (optional) the initial value returned by the hook, until data from the firestore query has loaded
129130

130131
Returns:
131132

@@ -150,6 +151,7 @@ The `useCollectionDataOnce` hook takes the following parameters:
150151
- `refField`: (optional) name of the field that should be populated with the `firebase.firestore.QuerySnapshot.ref` property.
151152
- `snapshotOptions`: (optional) `firebase.firestore.SnapshotOptions` to customise how data is retrieved from snapshots
152153
- `transform`: (optional) a function that receives the raw `firebase.firestore.DocumentData` for each item in the collection to allow manual transformation of the data where required by the application. See [`Transforming data`](#transforming-data) below.
154+
- `initialValue`: (optional) the initial value returned by the hook, until data from the firestore query has loaded
153155

154156
Returns:
155157

@@ -239,6 +241,7 @@ The `useDocumentData` hook takes the following parameters:
239241
- `snapshotListenOptions`: (optional) `firebase.firestore.SnapshotListenOptions` to customise how the collection is loaded
240242
- `snapshotOptions`: (optional) `firebase.firestore.SnapshotOptions` to customise how data is retrieved from snapshots
241243
- `transform`: (optional) a function that receives the raw `firebase.firestore.DocumentData` to allow manual transformation of the data where required by the application. See [`Transforming data`](#transforming-data) below.
244+
- `initialValue`: (optional) the initial value returned by the hook, until data from the firestore query has loaded
242245

243246
Returns:
244247

@@ -263,6 +266,7 @@ The `useDocumentDataOnce` hook takes the following parameters:
263266
- `refField`: (optional) name of the field that should be populated with the `firebase.firestore.QuerySnapshot.ref` property.
264267
- `snapshotOptions`: (optional) `firebase.firestore.SnapshotOptions` to customise how data is retrieved from snapshots
265268
- `transform`: (optional) a function that receives the raw `firebase.firestore.DocumentData` to allow manual transformation of the data where required by the application. See [`Transforming data`](#transforming-data) below.
269+
- `initialValue`: (optional) the initial value returned by the hook, until data from the firestore query has loaded
266270

267271
Returns:
268272

0 commit comments

Comments
 (0)