-
Notifications
You must be signed in to change notification settings - Fork 45
Update JS & Add styles #11
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks great. Just one comment
README.md
Outdated
web3.currentProvider, | ||
"ropsten" | ||
); | ||
(async () => await provider.send("eth_requestAccounts", []))(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind changing this to use .then()
instead of anonymous async-await so as to make it easier for beginners to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that but I could also just change the script tag to be <script type="module">
so top-level await is able to be used, which would make it easier to understand, while also being more up-to-date JavaScript. I'm not good at deciding which is better for newer developers, what do you recommend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@haardikk21 check my latest commits, I made it use .then
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i prefer async/await, but my sole concern here is with the anonymous function. having to do (async () => await ...)()
is weird unless you understand it, thats why i suggested .then
thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please let me know your Discord username so I can give you your role
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jords#0763
Changed some code to use up-to-date JavaScript and Ethers, as
var
is widely considered to be obsolete, and Ether's was giving warnings in console since the code was using outdated functions. I also added an optional step to add some styles to the code.