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

Implement spread binding #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Implement spread binding #57

wants to merge 1 commit into from

Conversation

sxxov
Copy link

@sxxov sxxov commented Jul 30, 2021

@Florian-Schoenherr
Copy link

really extensive 😄
I think the ... solution is pretty neat.

@RiseNet-Web
Copy link

really extensive smile
I think the ... solution is pretty neat.

Same

@UltraCakeBakery
Copy link

I would love to see this implemented.

@ghost
Copy link

ghost commented Nov 13, 2022

I like the idea, but I think a bind={object} syntax would be more terse.

@0x6563
Copy link

0x6563 commented May 1, 2023

Because the spread operator already exists for passing attributes, it seems tempting to use similar syntax for binding and even event handling. But I feel that semantically it doesn't really make sense.

To give you an example where I am coming from, a common practice when you use destructuring assignment in JS you do so to create a new object with a new reference, to prevent mutation on the source object.

ie: { url: 'foo.bar', headers: {...headers, authorization: 'API TOKEN' } }.

As much I like your suggestion of bind:{...object} which is easy to interpret at first glance. I think a good alternative maybe to use * as a wildcard.
ie:
bind:*={object}
on:*={object}
*={object}

Some Pros:

  • * is common enough as a wildcard
  • Wont require introducing any new syntax or logic at the parser level See: Ref
  • Can be handled in the Binding and EventHandler classes similar to how Attributes works.

@simonhvc
Copy link

This would be a nice feature to have. It helps us create more dynamic components and wrappers. Any updates on this?

@st3v3y
Copy link

st3v3y commented Jun 14, 2024

Any updates on this? It would be definitely a nice feature to have.

@mark-russ
Copy link

I hit a snag where I could really make use of this feature.

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.

8 participants