Skip to content

Commit 9abcaea

Browse files
committed
fix: ensure store reads do not trigger mutation errors
1 parent 793a8de commit 9abcaea

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/tidy-rockets-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: ensure store reads do not trigger mutation errors

packages/svelte/src/internal/client/reactivity/store.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { subscribe_to_store } from '../../../store/utils.js';
44
import { noop } from '../../shared/utils.js';
55
import { get } from '../runtime.js';
66
import { teardown } from './effects.js';
7-
import { mutable_source, set } from './sources.js';
7+
import { internal_set, mutable_source } from './sources.js';
88

99
/**
1010
* Gets the current value of a store. If the store isn't subscribed to yet, it will create a proxy
@@ -39,7 +39,7 @@ export function store_get(store, store_name, stores) {
3939
// inside a derived, we will hit the `state_unsafe_mutation` error if we `set` the value
4040
entry.source.v = v;
4141
} else {
42-
set(entry.source, v);
42+
internal_set(entry.source, v);
4343
}
4444
});
4545

0 commit comments

Comments
 (0)