@@ -304,7 +304,7 @@ export class Batch {
304304
305305dep . f ^= WAS_MARKED ;
306306
307- this . #clear_marked( /** @type {Derived } */ ( dep ) . deps ) ;
307+ this . #clear_marked( /** @type {Derived } */ ( dep ) . deps ) ;
308308}
309309}
310310
@@ -503,8 +503,8 @@ export class Batch {
503503this . #dirty_effects = [ ] ;
504504this . #maybe_dirty_effects = [ ] ;
505505
506- // Always flush if we have pending work that needs to be resolved
507- if ( this . #pending === 0 || queued_root_effects . length > 0 ) {
506+ // Flush if there are queued root effects, or if there is no pending work left.
507+ if ( queued_root_effects . length > 0 || this . #pending === 0 ) {
508508this . flush ( ) ;
509509}
510510
@@ -789,14 +789,14 @@ function mark_effects(value, sources, marked, checked) {
789789const flags = reaction . f ;
790790
791791if ( ( flags & DERIVED ) !== 0 ) {
792- mark_effects ( /** @type {Derived } */ ( reaction ) , sources , marked , checked ) ;
792+ mark_effects ( /** @type {Derived } */ ( reaction ) , sources , marked , checked ) ;
793793} else if (
794794( flags & ( ASYNC | BLOCK_EFFECT ) ) !== 0 &&
795795( flags & DIRTY ) === 0 &&
796796depends_on ( reaction , sources , checked )
797797) {
798798set_signal_status ( reaction , DIRTY ) ;
799- schedule_effect ( /** @type {Effect } */ ( reaction ) ) ;
799+ schedule_effect ( /** @type {Effect } */ ( reaction ) ) ;
800800}
801801}
802802}
@@ -816,10 +816,10 @@ function mark_eager_effects(value, effects) {
816816const flags = reaction . f ;
817817
818818if ( ( flags & DERIVED ) !== 0 ) {
819- mark_eager_effects ( /** @type {Derived } */ ( reaction ) , effects ) ;
819+ mark_eager_effects ( /** @type {Derived } */ ( reaction ) , effects ) ;
820820} else if ( ( flags & EAGER_EFFECT ) !== 0 ) {
821821set_signal_status ( reaction , DIRTY ) ;
822- effects . add ( /** @type {Effect } */ ( reaction ) ) ;
822+ effects . add ( /** @type {Effect } */ ( reaction ) ) ;
823823}
824824}
825825}
@@ -839,8 +839,8 @@ function depends_on(reaction, sources, checked) {
839839return true ;
840840}
841841
842- if ( ( dep . f & DERIVED ) !== 0 && depends_on ( /** @type {Derived } */ ( dep ) , sources , checked ) ) {
843- checked . set ( /** @type {Derived } */ ( dep ) , true ) ;
842+ if ( ( dep . f & DERIVED ) !== 0 && depends_on ( /** @type {Derived } */ ( dep ) , sources , checked ) ) {
843+ checked . set ( /** @type {Derived } */ ( dep ) , true ) ;
844844return true ;
845845}
846846}
0 commit comments