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

Conversation

Projects
None yet
2 participants
@AbhilashJN
Copy link
Contributor

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 as a code owner Oct 16, 2018

@welcome

This comment has been minimized.

Copy link

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 () => {

This comment has been minimized.

Copy link
@BinaryMuse

BinaryMuse Oct 16, 2018

Member

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

This comment has been minimized.

Copy link
@AbhilashJN

AbhilashJN Oct 16, 2018

Author Contributor

Sure that would be better. Will update.

@BinaryMuse
Copy link
Member

left a comment

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) {

This comment has been minimized.

Copy link
@BinaryMuse

BinaryMuse Oct 16, 2018

Member

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

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

This comment has been minimized.

Copy link
@AbhilashJN

AbhilashJN Oct 16, 2018

Author Contributor

Whoops!

@BinaryMuse BinaryMuse merged commit de1d24b into electron:master Oct 16, 2018

14 of 19 checks passed

ci/circleci: linux-ia32-testing Your tests failed on CircleCI
Details
appveyor: win-ia32-testing-pr Waiting for AppVeyor build to complete
Details
appveyor: win-x64-testing-pr Waiting for AppVeyor build to complete
Details
ci/circleci: mas-testing CircleCI is running your tests
Details
ci/circleci: osx-testing CircleCI is running your tests
Details
Absolute Zero
Semantic Pull Request ready to be squashed
Details
WIP ready for review
Details
ci/circleci: linux-arm-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-checkout Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing-tests Your tests passed on CircleCI!
Details
electron-lint Build #20181016.19 succeeded
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Oct 16, 2018

Release Notes Persisted

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

@welcome

This comment has been minimized.

Copy link

commented Oct 16, 2018

Congrats on merging your first pull request! 🎉🎉🎉

@BinaryMuse

This comment has been minimized.

Copy link
Member

commented Oct 16, 2018

Thanks @AbhilashJN!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.