Skip to content

Commit 41b26c5

Browse files
Feedback
1 parent 40ec00a commit 41b26c5

File tree

8 files changed

+92
-91
lines changed

8 files changed

+92
-91
lines changed

packages/firestore/exp/src/api/reference.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export interface SnapshotListenOptions {
9595
/**
9696
* Reads the document referred to by this `DocumentReference`.
9797
*
98-
* Note: getDoc() attempts to provide up-to-date data when possible by waiting
98+
* Note: `getDoc()` attempts to provide up-to-date data when possible by waiting
9999
* for data from the server, but it may return cached data or fail if you are
100100
* offline and the server cannot be reached. To specify this behavior, invoke
101101
* {@link getDocFromCache()} or @link getDocFromServer()}.
@@ -128,7 +128,7 @@ export function getDoc<T>(
128128

129129
/**
130130
* Reads the document referred to by this `DocumentReference` from cache.
131-
* Returns an error of the document is not currently cached.
131+
* Returns an error if the document is not currently cached.
132132
*
133133
* @return A Promise resolved with a DocumentSnapshot containing the
134134
* current document contents.
@@ -191,10 +191,10 @@ export function getDocFromServer<T>(
191191
/**
192192
* Executes the query and returns the results as a `QuerySnapshot`.
193193
*
194-
* Note: getDocs() attempts to provide up-to-date data when possible by waiting
195-
* for data from the server, but it may return cached data or fail if you are
196-
* offline and the server cannot be reached. To specify this behavior, invoke
197-
* {@link getDocsFromCache()} or {@link getDocsFromServer()}.
194+
* Note: `getDocs()` attempts to provide up-to-date data when possible by
195+
* waiting for data from the server, but it may return cached data or fail if
196+
* you are offline and the server cannot be reached. To specify this behavior,
197+
* invoke {@link getDocsFromCache()} or {@link getDocsFromServer()}.
198198
*
199199
* @return A Promise that will be resolved with the results of the Query.
200200
*/
@@ -222,7 +222,7 @@ export function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>> {
222222

223223
/**
224224
* Executes the query and returns the results as a `QuerySnapshot` from cache.
225-
* Returns an error of the document is not currently cached.
225+
* Returns an error if the document is not currently cached.
226226
*
227227
* @return A Promise that will be resolved with the results of the Query.
228228
*/
@@ -277,7 +277,7 @@ export function getDocsFromServer<T>(
277277
* @param reference A reference to the document to write.
278278
* @param data A map of the fields and values for the document.
279279
* @return A Promise resolved once the data has been successfully written
280-
* to the backend.
280+
* to the backend (Note that it won't resolve while you're offline).
281281
*/
282282
export function setDoc<T>(
283283
reference: DocumentReference<T>,
@@ -292,7 +292,7 @@ export function setDoc<T>(
292292
* @param data A map of the fields and values for the document.
293293
* @param options An object to configure the set behavior.
294294
* @return A Promise resolved once the data has been successfully written
295-
* to the backend.
295+
* to the backend (Note that it won't resolve while you're offline).
296296
*/
297297
export function setDoc<T>(
298298
reference: DocumentReference<T>,
@@ -336,7 +336,7 @@ export function setDoc<T>(
336336
* update the document. Fields can contain dots to reference nested fields
337337
* within the document.
338338
* @return A Promise resolved once the data has been successfully written
339-
* to the backend.
339+
* to the backend (Note that it won't resolve while you're offline).
340340
*/
341341
export function updateDoc(
342342
reference: DocumentReference<unknown>,
@@ -355,7 +355,7 @@ export function updateDoc(
355355
* @param value The first value.
356356
* @param moreFieldsAndValues Additional key value pairs.
357357
* @return A Promise resolved once the data has been successfully written
358-
* to the backend.
358+
* to the backend (Note that it won't resolve while you're offline).
359359
*/
360360
export function updateDoc(
361361
reference: DocumentReference<unknown>,
@@ -408,7 +408,7 @@ export function updateDoc(
408408
*
409409
* @param reference A reference to the document to delete.
410410
* @return A Promise resolved once the document has been successfully
411-
* deleted from the backend.
411+
* deleted from the backend (Note that it won't resolve while you're offline).
412412
*/
413413
export function deleteDoc(
414414
reference: DocumentReference<unknown>
@@ -427,7 +427,8 @@ export function deleteDoc(
427427
* @param reference A reference to the Collection to add this document to.
428428
* @param data An Object containing the data for the new document.
429429
* @return A Promise resolved with a `DocumentReference` pointing to the
430-
* newly created document after it has been written to the backend.
430+
* newly created document after it has been written to the backend (Note that it
431+
* won't resolve while you're offline).
431432
*/
432433
export function addDoc<T>(
433434
reference: CollectionReference<T>,

packages/firestore/exp/src/api/snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export class QuerySnapshot<T = DocumentData> {
450450
* Returns true if the provided snapshots are equal.
451451
*
452452
* @param left A snapshot to compare.
453-
* @param right A snapshot` to compare.
453+
* @param right A snapshot to compare.
454454
* @return true if the snapshots are equal.
455455
*/
456456
export function snapshotEqual<T>(

packages/firestore/exp/src/api/transaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export class Transaction extends LiteTransaction {
8484
* @param updateFunction The function to execute within the transaction context.
8585
* @return If the transaction completed successfully or was explicitly aborted
8686
* (the `updateFunction` returned a failed promise), the promise returned by the
87-
* updateFunction is returned here. Else, if the transaction failed, a rejected
88-
* promise with the corresponding failure error will be returned.
87+
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
88+
* rejected promise with the corresponding failure error is returned.
8989
*/
9090
export function runTransaction<T>(
9191
firestore: FirebaseFirestore,

packages/firestore/lite/src/api/bytes.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export class Bytes {
2929
}
3030

3131
/**
32-
* Creates a new Bytes object from the given Base64 string, converting it to
32+
* Creates a new `Bytes` object from the given Base64 string, converting it to
3333
* bytes.
3434
*
35-
* @param base64 The Base64 string used to create the Blob object.
35+
* @param base64 The Base64 string used to create the `Bytes` object.
3636
*/
3737
static fromBase64String(base64: string): Bytes {
3838
try {
@@ -46,9 +46,9 @@ export class Bytes {
4646
}
4747

4848
/**
49-
* Creates a new Bytes object from the given Uint8Array.
49+
* Creates a new `Bytes` object from the given Uint8Array.
5050
*
51-
* @param array The Uint8Array used to create the Blob object.
51+
* @param array The Uint8Array used to create the `Bytes` object.
5252
*/
5353
static fromUint8Array(array: Uint8Array): Bytes {
5454
return new Bytes(ByteString.fromUint8Array(array));
@@ -57,7 +57,7 @@ export class Bytes {
5757
/**
5858
* Returns the underlying bytes as a Base64-encoded string.
5959
*
60-
* @return The Base64-encoded string created from the Bytes object.
60+
* @return The Base64-encoded string created from the `Bytes` object.
6161
*/
6262
toBase64(): string {
6363
return this._byteString.toBase64();
@@ -66,16 +66,16 @@ export class Bytes {
6666
/**
6767
* Returns the underlying bytes in a new Uint8Array.
6868
*
69-
* @return The Uint8Array created from the Bytes object.
69+
* @return The Uint8Array created from the `Bytes` object.
7070
*/
7171
toUint8Array(): Uint8Array {
7272
return this._byteString.toUint8Array();
7373
}
7474

7575
/**
76-
* Returns a string representation of the Bytes object.
76+
* Returns a string representation of the `Bytes` object.
7777
*
78-
* @return A string representation of the Bytes object.
78+
* @return A string representation of the `Bytes` object.
7979
*/
8080
toString(): string {
8181
return 'Bytes(base64: ' + this.toBase64() + ')';

packages/firestore/lite/src/api/field_value.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function serverTimestamp(): FieldValue {
6565
* containing exactly the specified elements.
6666
*
6767
* @param elements The elements to union into the array.
68-
* @return The FieldValue sentinel for use in a call to `setDoc()` or
68+
* @return The `FieldValue` sentinel for use in a call to `setDoc()` or
6969
* `updateDoc()`.
7070
*/
7171
export function arrayUnion(...elements: unknown[]): FieldValue {
@@ -83,7 +83,7 @@ export function arrayUnion(...elements: unknown[]): FieldValue {
8383
* already an array it will be overwritten with an empty array.
8484
*
8585
* @param elements The elements to remove from the array.
86-
* @return The FieldValue sentinel for use in a call to `setDoc()` or
86+
* @return The `FieldValue` sentinel for use in a call to `setDoc()` or
8787
* `updateDoc()`
8888
*/
8989
export function arrayRemove(...elements: unknown[]): FieldValue {
@@ -109,7 +109,7 @@ export function arrayRemove(...elements: unknown[]): FieldValue {
109109
* yet exist, the transformation sets the field to the given value.
110110
*
111111
* @param n The value to increment by.
112-
* @return The FieldValue sentinel for use in a call to `setDoc()` or
112+
* @return The `FieldValue` sentinel for use in a call to `setDoc()` or
113113
* `updateDoc()`
114114
*/
115115
export function increment(n: number): FieldValue {

0 commit comments

Comments
 (0)