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

Use arrow functions for anonymous functions where possible (part #8) #19191

Merged
merged 71 commits into from
Aug 8, 2022

Conversation

teoli2003
Copy link
Contributor

Arrow functions are shorter and easier to read (but doesn't bind this).

@github-actions github-actions bot added the Content:WebAPI Web API docs label Aug 5, 2022
@github-actions

This comment was marked as resolved.

@@ -594,7 +594,7 @@ Demo: [Device pixel presnap](https://kdashg.github.io/misc/webgl/device-pixel-pr
On supporting browsers (Chromium?), `ResizeObserver` can be used with `'device-pixel-content-box'` to request a callback that includes the true device pixel size of an element. This can be used to build an async-but-accurate function:

```js
window.getDevicePixelSize = window.getDevicePixelSize || async function(elem) {
window.getDevicePixelSize = window.getDevicePixelSize || async (elem) => {
Copy link
Member

Choose a reason for hiding this comment

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

Need parens; this looks like a polyfill?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some parenthesis, hope it is correct.

@teoli2003 teoli2003 requested review from Josh-Cena and removed request for wbamberg August 8, 2022 12:01
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

All boxes are ticked on my end—LGTM!

@Josh-Cena Josh-Cena merged commit fa3fe2e into mdn:main Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants