Skip to content

Fix drag and drop example#357

Merged
mkruisselbrink merged 2 commits into
WICG:mainfrom
tomayac:patch-12
Feb 11, 2022
Merged

Fix drag and drop example#357
mkruisselbrink merged 2 commits into
WICG:mainfrom
tomayac:patch-12

Conversation

@tomayac

@tomayac tomayac commented Jan 24, 2022

Copy link
Copy Markdown
Contributor

Fixes #356


Preview | Diff

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

Copy link
Copy Markdown

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
Copy Markdown
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.

Copy link
Copy Markdown

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
Copy Markdown
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 :-)

Comment thread index.bs Outdated
@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