mirror of https://github.com/sveltejs/svelte
fix: ensure inspect effects are skipped from effect parent logic (#12810)
parent
34ad016a77
commit
fa5d3a9002
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure inspect effects are skipped from effect parent logic
|
@ -0,0 +1,11 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
|
||||
async test({ assert, logs }) {
|
||||
assert.deepEqual(logs, ['init', 0, 'update', 1]);
|
||||
}
|
||||
});
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
let a = $state(0);
|
||||
let b = $derived.by(() => {
|
||||
$effect(() => {
|
||||
a = 1;
|
||||
})
|
||||
return a;
|
||||
})
|
||||
|
||||
$inspect(b);
|
||||
</script>
|
||||
|
Loading…
Reference in new issue