Skip to content

Commit afe4dbe

Browse files
committed
resolve conflicts
1 parent 24113b4 commit afe4dbe

File tree

1 file changed

+26
-0
lines changed
  • packages/svelte/tests/signals

1 file changed

+26
-0
lines changed

packages/svelte/tests/signals/test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,32 @@ describe('signals', () => {
740740
};
741741
});
742742

743+
test('nested deriveds clean up the relationships when used with untrack', () => {
744+
return () => {
745+
let a = render_effect(() => {});
746+
747+
const destroy = effect_root(() => {
748+
a = render_effect(() => {
749+
$.untrack(() => {
750+
const b = derived(() => {
751+
const c = derived(() => {});
752+
$.untrack(() => {
753+
$.get(c);
754+
});
755+
});
756+
$.get(b);
757+
});
758+
});
759+
});
760+
761+
assert.deepEqual(a.deriveds?.length, 1);
762+
763+
destroy();
764+
765+
assert.deepEqual(a.deriveds, null);
766+
};
767+
});
768+
743769
test('bigint states update correctly', () => {
744770
return () => {
745771
const count = state(0n);

0 commit comments

Comments
 (0)