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(bind): Fix eventname and controller binding bugs. #31

Merged
merged 4 commits into from
Apr 9, 2020
Merged

Conversation

latentflip
Copy link
Contributor

This is a quick PR to fix

I'm not 100% in love with the implementation here. I broke out bindActionsToController to avoid doing something like this:

for (const el of [this, ...this.querySelectorAll(`[data-action*=":${tag}#"]`)]) {

but that's resulted in quite a hefty diff. I broke it up into clear commits for review, but maybe there's a better-better way I've missed?

@latentflip latentflip requested a review from a team as a code owner April 6, 2020 09:54
Copy link
Contributor

@koddsson koddsson left a comment

Choose a reason for hiding this comment

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

I think allowing : in a event name is great and a oversight on our part so that's great to get fixed.

I kind of like the approach of this for loop:

for (const el of [this, ...this.querySelectorAll(`[data-action*=":${tag}#"]`)]) {

rather than creating a bindActionsToController function but that might just be a personal preference.

In any case this looks good to me and I'm not overly fuzzed about coding style.

Copy link
Member

@keithamus keithamus left a comment

Choose a reason for hiding this comment

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

This works well, I think either pattern is good 👍

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

3 participants