mirror of https://github.com/sveltejs/svelte
fix extra invalidation with component prop binding to object property (#5890)
parent
8867bc31c2
commit
a9c1dc9b59
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
export let value;
|
||||
export let value2;
|
||||
</script>
|
||||
|
||||
{value}{value2}
|
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
async test({ assert, component }) {
|
||||
assert.equal(component.object_updates, component.primitive_updates);
|
||||
}
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
|
||||
export let primitive_updates = 0;
|
||||
export let object_updates = 0;
|
||||
|
||||
const obj = { foo: '' };
|
||||
let foo = 'bar';
|
||||
$: if (obj) object_updates++;
|
||||
$: if (foo) primitive_updates++;
|
||||
</script>
|
||||
|
||||
<Component bind:value={obj.foo} bind:value2={foo} />
|
Loading…
Reference in new issue