mirror of https://github.com/sveltejs/svelte
1) Passing previous value to `invalidate` callback. ```javascript store$.subscribe(value => { console.log('new value', value); }, value => { console.log('prev value', value); }); ``` 2) Custom equality checking callback passed as the third argument of `writable`. Very useful then store value is object or array. ``` const user$ = writable({}, undefined, (value, newValue) => { return value.name !== newValue.name; }); ```pull/3575/head
parent
14a46a17d0
commit
df8f686fc1
Loading…
Reference in new issue