Skip to content

Commit 84e2a40

Browse files
committed
simplify
1 parent 82f3be2 commit 84e2a40

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/svelte/src/internal/client/runtime.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ export function mutate(source, update) {
887887
* @template V
888888
*/
889889
export function mutate_store(store, get_value, update) {
890-
var updated = update(untrack(get_value));
891-
// mutation could result in a new store being tracked, therefore call get_value again
892-
store.set(untrack(get_value));
890+
const value = untrack(get_value);
891+
var updated = update(value);
892+
store.set(value);
893893
return updated;
894894
}
895895

0 commit comments

Comments
 (0)