Skip to content

Commit 3ce2fe4

Browse files
Promise
1 parent 9aec165 commit 3ce2fe4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/firestore/src/core/firestore_client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ export async function setOnlineComponentProvider(
322322
firestoreClient.onlineComponents = onlineComponentProvider;
323323
}
324324

325-
export async function getPersistence(
325+
export function getPersistence(
326326
firestoreClient: FirestoreClient
327327
): Promise<Persistence> {
328-
return (await ensureOfflineComponents(firestoreClient)).persistence;
328+
return ensureOfflineComponents(firestoreClient).then(o => o.persistence);
329329
}
330330

331331
/** Enables the network connection and re-enqueues all pending operations. */
@@ -341,10 +341,10 @@ export async function firestoreClientEnableNetwork(
341341
});
342342
}
343343

344-
export async function getRemoteStore(
344+
export function getRemoteStore(
345345
firestoreClient: FirestoreClient
346346
): Promise<RemoteStore> {
347-
return (await ensureOnlineComponents(firestoreClient)).remoteStore;
347+
return ensureOnlineComponents(firestoreClient).then(o => o.remoteStore);
348348
}
349349

350350
/** Disables the network connection. Pending operations will not complete. */
@@ -360,10 +360,10 @@ export async function firestoreClientDisableNetwork(
360360
});
361361
}
362362

363-
export async function getSyncEngine(
363+
export function getSyncEngine(
364364
firestoreClient: FirestoreClient
365365
): Promise<SyncEngine> {
366-
return (await ensureOnlineComponents(firestoreClient)).syncEngine;
366+
return ensureOnlineComponents(firestoreClient).then(c => c.syncEngine);
367367
}
368368

369369
/**

0 commit comments

Comments
 (0)