mirror of https://github.com/sveltejs/svelte
fix: ensure transient writes to tracked parent effects works as expected (#15506)
* ix: ensure transient writes to tracked parent effects works as expected * lint * format test * tweak changeset --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/15510/head
parent
b27ca425c7
commit
5d3aa2bda4
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: invalidate parent effects when child effects update parent dependencies
|
@ -0,0 +1,7 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
test({ assert, target, logs }) {
|
||||||
|
assert.deepEqual(logs, ['Outer', 'Inner', 'Outer', 'Inner']);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,13 @@
|
|||||||
|
<script>
|
||||||
|
let value = $state(0);
|
||||||
|
|
||||||
|
$effect.pre(() => {
|
||||||
|
console.log("Outer");
|
||||||
|
value;
|
||||||
|
|
||||||
|
$effect.pre(() => {
|
||||||
|
console.log("Inner");
|
||||||
|
value = 10;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in new issue