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

Fix drag and drop example #357

Merged
merged 2 commits into from
Feb 11, 2022
Merged

Fix drag and drop example #357

merged 2 commits into from
Feb 11, 2022

Conversation

tomayac
Copy link
Contributor

@tomayac tomayac commented Jan 24, 2022

Fixes #356


Preview | Diff

index.bs Outdated
}
const fileHandlesPromises = [...e.dataTransfer.items]
.filter((item) => item.kind === 'file')
.map((item) => item.getAsFileSystemHandle());

Choose a reason for hiding this comment

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

you don't need () around item when there is just one argument. .map(item => item.getAsFileSystemHandle()); works fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a style guide thing. Google highly recommends adding braces.

Choose a reason for hiding this comment

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

I see. I usually leave them out as they just add more noise and make the code less readable in my opinion :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the spec, the Google Style Guide doesn't apply here. Feel free to remove, I don't have hard feelings. It's a prettier rule that I have in muscle memory :-)

@mkruisselbrink mkruisselbrink merged commit 2ccefeb into WICG:main Feb 11, 2022
github-actions bot added a commit that referenced this pull request Feb 11, 2022
* Fix drag and drop example

Fixes #356

* Update index.bs

SHA: 2ccefeb
Reason: push, by @mkruisselbrink

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@tomayac tomayac deleted the patch-12 branch February 14, 2022 09:01
fivedots pushed a commit that referenced this pull request Feb 28, 2022
* Fix drag and drop example

Fixes #356

* Update index.bs
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.

Bug in example in specification
3 participants