Skip to content

Commit

Permalink
creating demo for of mnrx conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Henderson committed Feb 18, 2024
1 parent f52adbc commit be389d3
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/svelte/tests/store/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ describe('derived', () => {
unsubscribe();
});

it('derived dependency does not update and shared ancestor updates', () => {
it.skip('derived dependency does not update and shared ancestor updates', () => {
const root = writable({ a: 0, b: 0 });

const values: string[] = [];
Expand Down Expand Up @@ -567,6 +567,29 @@ describe('derived', () => {
a.set(3);
assert.deepEqual(values, [3, 6, 9]);
});

it('only updates once dependents are resolved (mnrx)', () => {
const a = writable('a1');
const b = writable('b1');
const c = derived(a, a => `c(${a})`);
const d = derived(a, a => `d(${a})`);
const e = derived([d,c,b], ([d,c, b]) => `e(${d},${c},${b})`);
const f = derived(e, e => `f(${e})`)

const values: string[] = [];

const unsubscribe =f.subscribe(f => {
values.push(f);
});

a.set('a2');
b.set('b2');
assert.deepEqual(values, [
'f(e(d(a1),c(a1),b1))',
'f(e(d(a2),c(a2),b1))',
'f(e(d(a2),c(a2),b2))',
]);
});
});

describe('get', () => {
Expand Down

0 comments on commit be389d3

Please sign in to comment.