Skip to content

Commit 7239f49

Browse files
Match DocumentReference
1 parent e63d8cd commit 7239f49

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/firestore/src/api/database.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ export class Firestore
649649

650650
batch(): PublicWriteBatch {
651651
this._ensureClientConfigured();
652-
return new WriteBatch(this, this._firestoreClient!);
652+
return new WriteBatch(this);
653653
}
654654

655655
// Visible for testing.
@@ -814,11 +814,11 @@ export class Transaction implements PublicTransaction {
814814
export class WriteBatch implements PublicWriteBatch {
815815
private _mutations = [] as Mutation[];
816816
private _committed = false;
817+
private _firestoreClient: FirestoreClient;
817818

818-
constructor(
819-
private _firestore: Firestore,
820-
private _firestoreClient: FirestoreClient
821-
) {}
819+
constructor(private _firestore: Firestore) {
820+
this._firestoreClient = _firestore._ensureClientConfigured();
821+
}
822822

823823
set<T>(
824824
documentRef: DocumentReference<T>,

0 commit comments

Comments
 (0)