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

Some feedback on getBalanceAll implementation #2

Open
wants to merge 4 commits into
base: feature/get-balance-all
Choose a base branch
from

Conversation

picnicbear
Copy link

You don't have to use these commits (I included a lot of comments and I haven't tested it with my changes yet)
But I think leveraging inheritance more in the bulk client class would be good
And most of the other updates are more stylistic or minute optimizations, so feel free to take or leave them


async.each(requests, getServerWithAuthWrapper, cb2);
// return a list of promises that we can await or chain
Copy link
Author

Choose a reason for hiding this comment

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

it's not particularly necessary to do this (you can alternatively return a Promise.all), but this way is slightly more efficient

Copy link
Author

Choose a reason for hiding this comment

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

(However, we'd need to resolve a representation of any error, which is kind of weird)


try {
responses = await Promise.all(
getServerWithMultiAuth(req, res, opts).map(promise =>
Copy link
Author

Choose a reason for hiding this comment

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

my bad, we don't need to pass opts here

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