Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remove unnecessary Promises from transaction write functions #64

Merged
merged 1 commit into from
Dec 8, 2020

Conversation

reedom
Copy link
Contributor

@reedom reedom commented Aug 15, 2020

Since the original Firestore's tx write functions are synchronous.

e.g.

set(documentRef: DocumentReference, data: DocumentData,
  options?: SetOptions): Transaction;

After this fix, I expect that some of my functions can be called within either tx or batch.
Prior to migrating to typesaurus, I had lines like:

async function incrementCounter(
  writer: Transaction | WriteBatch,
  kind: string,
  delta: number
)

I want to do the same but if the return type of each function differs, it's difficult to cope with.

Since the original Firestore's tx write functions are synchronous.

e.g.
```ts
set(documentRef: DocumentReference, data: DocumentData,
  options?: SetOptions): Transaction;
```
Copy link
Owner

@kossnocorp kossnocorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thank you!

@kossnocorp kossnocorp merged commit 4d95ba0 into kossnocorp:master Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants