-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat: support for spreading function bindings #16607
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 2825bce The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thank you! I think this would need to run inside an effect, or use a derived, since otherwise something like this... <input bind:value={...binding(validation, defaults)} /> ...wouldn't update if |
Thanks! I wrapped the call to |
Thanks — I actually missed before that both A nice bonus: no |
…g the SpreadElement as the expression
dcda57d
to
2f1792e
Compare
Good point, having a stricter contract makes sense and makes the implementation and tests simpler, as well as being able to remove One quirk of the implementation that I noticed is that things like Maybe |
Closes: #16086
Adds support for spreading function bindings using
...
syntax.Before:
After:
Works with arrays
[get, set]
and objects{get, set}
.If either
get
orset
is nullish it's a noop.If either
get
orset
is not a function a runtime error is thrown.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint