We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e57669 commit 42f73a0Copy full SHA for 42f73a0
packages/svelte/src/internal/client/proxy.js
@@ -168,10 +168,12 @@ export function proxy(value, onchange) {
168
// we either add or remove the passed in value
169
// to the onchanges array or we set every source onchange
170
// to the passed in value (if it's undefined it will make the chain stop)
171
- if (onchange != null && value && !remove) {
172
- onchanges?.add?.(value);
173
- } else if (onchange != null && value) {
174
- onchanges?.delete?.(value);
+ if (onchange != null && value) {
+ if (remove) {
+ onchanges?.delete(value);
+ } else {
175
+ onchanges?.add(value);
176
+ }
177
} else {
178
onchange = value;
179
for (let [, s] of sources) {
0 commit comments