fix: add close() in the wrapper#986
Conversation
danieljbruce
left a comment
There was a problem hiding this comment.
Just one comment on a return value
danieljbruce
left a comment
There was a problem hiding this comment.
Advice on making this a little more concise.
src/index.ts
Outdated
| * Terminate grpc channels and close all the clients. | ||
| */ | ||
| close(): Promise<void[]> { | ||
| const combined = []; |
There was a problem hiding this comment.
I think to achieve what you want here we can condense the first ten lines of this function to const combined = Object.keys(this.api).map(clientType => this.api[clientType].close()).
There was a problem hiding this comment.
If this isn't exactly right I can try to tweak it later or help with debugging.
There was a problem hiding this comment.
This works, thank you!
| /** | ||
| * Terminate grpc channels and close all the clients. | ||
| */ | ||
| close(): Promise<void[]> { |
There was a problem hiding this comment.
Maybe we can add a test to make sure request will fail after client is closed, I'll work on it next week!
danieljbruce
left a comment
There was a problem hiding this comment.
Suggestions for end of close function
🤖 I have created a release *beep* *boop* --- ## [3.9.0](v3.8.0...v3.9.0) (2022-01-18) ### Features * add Autoscaling API ([#963](#963)) ([86d21e8](86d21e8)) ### Bug Fixes * add close() in the wrapper ([#986](#986)) ([839f429](839f429)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕