File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export function proxy(value, onchange) {
2929}
3030
3131let batching = false ;
32+ let changed_in_batch = false ;
3233
3334/**
3435 * @template T
@@ -200,11 +201,16 @@ export function create_proxy(value, onchanges) {
200201 return function ( ...args ) {
201202 try {
202203 batching = true ;
204+ changed_in_batch = false ;
203205
204206 // @ts -expect-error
205207 return v . apply ( this , args ) ;
206208 } finally {
207209 batching = false ;
210+
211+ if ( changed_in_batch ) {
212+ run_all ( onchanges ) ;
213+ }
208214 }
209215 } ;
210216 }
@@ -293,6 +299,8 @@ export function create_proxy(value, onchanges) {
293299 sources . set ( i + '' , other_s ) ;
294300 }
295301 }
302+ } else if ( batching ) {
303+ changed_in_batch = true ;
296304 }
297305
298306 // If we haven't yet created a source for this property, we need to ensure
You can’t perform that action at this time.
0 commit comments