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

docs: change examples in docs to use for..of and async/await (#14842) #15196

Merged
merged 5 commits into from Oct 16, 2018
Merged

docs: change examples in docs to use for..of and async/await (#14842) #15196

merged 5 commits into from Oct 16, 2018

Conversation

AbhilashJN
Copy link
Contributor

@AbhilashJN AbhilashJN commented Oct 16, 2018

Description of Change

Changed code examples in desktop-capturer.md and using-selenium-and-webdriver.md to use for..of and async/await instead of normal for loop and Promises.
CC @ckerr @codebytere

Checklist

  • PR description included and stakeholders cc'd
  • relevant documentation is changed or added
  • PR title follows semantic commit guidelines

Release Notes

Notes: docs: update some examples in documentation to use async/await and for..of

@AbhilashJN AbhilashJN requested a review from a team October 16, 2018 14:55
@welcome
Copy link

welcome bot commented Oct 16, 2018

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

}).then(function () {
});

(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this example would be a little more clear if we made this a named async function instead of an IIFE. Thoughts? 💭

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure that would be better. Will update.

Copy link
Contributor

@BinaryMuse BinaryMuse left a comment

Choose a reason for hiding this comment

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

It looks like we use async/await elsewhere, I'd be 👍 for this change

maxWidth: 1280,
minHeight: 720,
maxHeight: 720
for (const source in sources) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the PR title, I assume this should be of :)

Suggested change
for (const source in sources) {
for (const source of sources) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops!

@BinaryMuse BinaryMuse merged commit de1d24b into electron:master Oct 16, 2018
@release-clerk
Copy link

release-clerk bot commented Oct 16, 2018

Release Notes Persisted

docs: update some examples in documentation to use async/await and for..of

@welcome
Copy link

welcome bot commented Oct 16, 2018

Congrats on merging your first pull request! 🎉🎉🎉

@BinaryMuse
Copy link
Contributor

Thanks @AbhilashJN!

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.

None yet

2 participants