We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 303f24e commit e1927e1Copy full SHA for e1927e1
packages/svelte/tests/signals/test.ts
@@ -818,6 +818,28 @@ describe('signals', () => {
818
};
819
});
820
821
+ test('unowned deriveds are correctly connected and disconnected from the graph #2', () => {
822
+ return () => {
823
+ let a = state(0);
824
+ let b = state(true);
825
+ let c = derived(() => $.get(a));
826
+ let d = derived(() => ($.get(b) ? 1 : $.get(a) + $.get(c) + $.get(a)));
827
+
828
+ $.get(d);
829
830
+ assert.equal(d.deps?.length, 1);
831
832
833
834
+ set(a, 1);
835
+ set(b, false);
836
837
838
839
+ assert.equal(d.deps?.length, 3);
840
+ };
841
+ });
842
843
test('unowned deriveds correctly update', () => {
844
return () => {
845
const arr1 = proxy<{ a: number }[]>([]);
0 commit comments