@@ -195,9 +195,7 @@ export class FirestoreClient {
195
195
} ) ;
196
196
197
197
// Block the async queue until initialization is done
198
- this . asyncQueue . enqueueAndForget ( ( ) => {
199
- return this . initializationDone . promise ;
200
- } ) ;
198
+ this . asyncQueue . enqueueAndForget ( ( ) => this . initializationDone . promise ) ;
201
199
202
200
// Return only the result of enabling persistence. Note that this does not
203
201
// need to await the completion of initializationDone because the result of
@@ -409,8 +407,8 @@ export class FirestoreClient {
409
407
docKey : DocumentKey
410
408
) : Promise < Document | null > {
411
409
this . verifyNotTerminated ( ) ;
412
- await this . initializationDone ;
413
- return enqueueReadDocumentFromLocalCache (
410
+ await this . initializationDone . promise ;
411
+ return enqueueReadDocumentFromCache (
414
412
this . asyncQueue ,
415
413
this . localStore ,
416
414
docKey
@@ -419,8 +417,8 @@ export class FirestoreClient {
419
417
420
418
async getDocumentsFromLocalCache ( query : Query ) : Promise < ViewSnapshot > {
421
419
this . verifyNotTerminated ( ) ;
422
- await this . initializationDone ;
423
- return enqueueExecuteQueryFromLocalCache (
420
+ await this . initializationDone . promise ;
421
+ return enqueueExecuteQueryFromCache (
424
422
this . asyncQueue ,
425
423
this . localStore ,
426
424
query
@@ -540,7 +538,7 @@ export function enqueueSnapshotsInSyncListen(
540
538
} ;
541
539
}
542
540
543
- export async function enqueueReadDocumentFromLocalCache (
541
+ export async function enqueueReadDocumentFromCache (
544
542
asyncQueue : AsyncQueue ,
545
543
localStore : LocalStore ,
546
544
docKey : DocumentKey
@@ -575,7 +573,7 @@ export async function enqueueReadDocumentFromLocalCache(
575
573
return deferred . promise ;
576
574
}
577
575
578
- export async function enqueueExecuteQueryFromLocalCache (
576
+ export async function enqueueExecuteQueryFromCache (
579
577
asyncQueue : AsyncQueue ,
580
578
localStore : LocalStore ,
581
579
query : Query
0 commit comments