File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
packages/firestore/lite/src/api Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -178,15 +178,14 @@ export function runTransaction<T>(
178
178
updateFunction : ( transaction : firestore . Transaction ) => Promise < T >
179
179
) : Promise < T > {
180
180
const firestoreClient = cast ( firestore , Firestore ) ;
181
- return getDatastore ( firestoreClient ) . then ( async datastore => {
182
- const deferred = new Deferred < T > ( ) ;
183
- new TransactionRunner < T > (
184
- new AsyncQueue ( ) ,
185
- datastore ,
186
- internalTransaction =>
187
- updateFunction ( new Transaction ( firestoreClient , internalTransaction ) ) ,
188
- deferred
189
- ) . run ( ) ;
190
- return deferred . promise ;
191
- } ) ;
181
+ const datastore = getDatastore ( firestoreClient ) ;
182
+ const deferred = new Deferred < T > ( ) ;
183
+ new TransactionRunner < T > (
184
+ new AsyncQueue ( ) ,
185
+ datastore ,
186
+ internalTransaction =>
187
+ updateFunction ( new Transaction ( firestoreClient , internalTransaction ) ) ,
188
+ deferred
189
+ ) . run ( ) ;
190
+ return deferred . promise ;
192
191
}
Original file line number Diff line number Diff line change @@ -181,9 +181,8 @@ export function writeBatch(
181
181
firestore : firestore . FirebaseFirestore
182
182
) : firestore . WriteBatch {
183
183
const firestoreImpl = cast ( firestore , Firestore ) ;
184
+ const datastore = getDatastore ( firestoreImpl ) ;
184
185
return new WriteBatch ( firestoreImpl , writes =>
185
- getDatastore ( firestoreImpl ) . then ( datastore =>
186
- invokeCommitRpc ( datastore , writes )
187
- )
186
+ invokeCommitRpc ( datastore , writes )
188
187
) ;
189
188
}
You can’t perform that action at this time.
0 commit comments