pull/9685/head
Simon Holthausen 3 years ago
parent 82f3be2a66
commit 84e2a407ea

@ -887,9 +887,9 @@ export function mutate(source, update) {
* @template V * @template V
*/ */
export function mutate_store(store, get_value, update) { export function mutate_store(store, get_value, update) {
var updated = update(untrack(get_value)); const value = untrack(get_value);
// mutation could result in a new store being tracked, therefore call get_value again var updated = update(value);
store.set(untrack(get_value)); store.set(value);
return updated; return updated;
} }

Loading…
Cancel
Save