File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed
src/internal/client/reactivity
tests/runtime-runes/samples/1000-reading-derived-effects Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ function flush_queued_effects(effects) {
563
563
var effect = effects [ i ++ ] ;
564
564
565
565
if ( ( effect . f & ( DESTROYED | INERT ) ) === 0 && is_dirty ( effect ) ) {
566
- var wv = write_version ;
566
+ var n = current_batch ? current_batch . current . size : 0 ;
567
567
568
568
update_effect ( effect ) ;
569
569
@@ -586,7 +586,11 @@ function flush_queued_effects(effects) {
586
586
587
587
// if state is written in a user effect, abort and re-schedule, lest we run
588
588
// effects that should be removed as a result of the state change
589
- if ( write_version > wv && ( effect . f & USER_EFFECT ) !== 0 ) {
589
+ if (
590
+ current_batch !== null &&
591
+ current_batch . current . size > n &&
592
+ ( effect . f & USER_EFFECT ) !== 0
593
+ ) {
590
594
break ;
591
595
}
592
596
}
Original file line number Diff line number Diff line change
1
+ <script >
2
+ const der = $derived (false );
3
+
4
+ $effect (() => {
5
+ der
6
+ });
7
+ </script >
Original file line number Diff line number Diff line change
1
+ import { test } from '../../test' ;
2
+
3
+ export default test ( {
4
+ async test ( ) { }
5
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <script >
2
+ import Component from ' ./Component.svelte'
3
+ const arr = Array .from ({length: 10001 });
4
+ </script >
5
+
6
+ {#each arr }
7
+ < Component / >
8
+ {/ each }
You can’t perform that action at this time.
0 commit comments