firebase / firebase/firebase-js-sdk
[Question]: WriteBatch and Transaction method return types
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
I'm working on an internal code library and I have some code that is only concerned with `set()`, `update()` and `delete()` methods of `WriteBatch` and `Transaction`. I notice the only thing that differs between the methods is the return type. Transaction return type is `:this` and WriteBatch is `:WriteBatch`
For example the set()'s:
- https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/lite-api/transaction.ts#L130
- https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/lite-api/write_batch.ts#L76
I wondered if it would be a possibility for them to all use the `:this` return type? I'd like to be able to use the 2 types interchangeably based on an interface of only those few methods. Thank you for your time.
Contributor guide
Assessment
This issue has not been assessed yet.