Skip to content

Commit 558498a

Browse files
committed
add test
1 parent 89cbcb0 commit 558498a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { test } from '../../test';
2+
3+
// nothing to test here — if the teardown function is not untracked, effect will loop
4+
export default test({});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script>
2+
let prop = $state();
3+
let key = $state({});
4+
5+
function action() {
6+
prop = {};
7+
$effect.pre(() => {
8+
return () => {
9+
prop;
10+
}
11+
});
12+
}
13+
14+
$effect(() => key = {});
15+
</script>
16+
17+
{#key key}
18+
<div use:action>test</div>
19+
{/key}

0 commit comments

Comments
 (0)