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

Suggestion: switch to async/await from nested promises in code #634

Closed
yayajacky opened this issue Oct 23, 2019 · 4 comments
Closed

Suggestion: switch to async/await from nested promises in code #634

yayajacky opened this issue Oct 23, 2019 · 4 comments
Assignees

Comments

@yayajacky
Copy link

Hi:

I noticed that there are places where the promise chain is nested, would you mind if I do a PR for BaseProvider and others to switch them to async/await (for methods that return Promise)?

Or, is there a reason for not using async/await at the moment?

If that's the case, flattening promises would be good too.

Thanks!

@ricmoo
Copy link
Member

ricmoo commented Oct 24, 2019

I'll be making these changes soon, along with switching a large number of let to const, across the packages. :)

The original reason for not doing this was that I was targeting ES3, but since it is all in TypeScript now, it can easily handle all that during compilation. :)

@ricmoo ricmoo added next version on-deck This Enhancement or Bug is currently being worked on. labels Oct 24, 2019
@ricmoo ricmoo self-assigned this Oct 24, 2019
@yayajacky
Copy link
Author

Thank you very much!

@pcowgill
Copy link

@ricmoo That’s great news!!

@ricmoo
Copy link
Member

ricmoo commented Nov 20, 2019

Much of the codebase has now been migrated, and when I notice little areas here and there that could benefit from this I'm updating them.

I'm going to close this now, but please feel free to re-open or if you notice somewhere that could benefit, add a comment to this issue.

Thanks! :)

@ricmoo ricmoo closed this as completed Nov 20, 2019
@ricmoo ricmoo removed the on-deck This Enhancement or Bug is currently being worked on. label Jan 11, 2020
michaeltout pushed a commit to michaeltout/ethers.js that referenced this issue Aug 23, 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

No branches or pull requests

3 participants