Description
Brought up in chat by @arxpoetica: when using spread to apply an object's properties to an element, it is desirable to be able to say "apply everything except these specific properties".
Say, for example, something like <svelte:component this={MyComponent} {...all} />
, which would result in a MyComponent
property being set on the component.
If the spread operator ignored falsey values (or more safely, just ignored undefined values) on the object, it would be relatively easy to use something like Object.assign
to specifically exclude some properties, say with this computed property:
computed: {
forSpread: all => Object.assign({}, all, { MyComponent: undefined })
}