@ -196,34 +196,34 @@ export function check_dirtiness(reaction) {
if ( dependencies !== null ) {
if ( dependencies !== null ) {
var i ;
var i ;
var dependency ;
if ( ( flags & DISCONNECTED ) !== 0 ) {
var is _disconnected = ( flags & DISCONNECTED ) !== 0 ;
for ( i = 0 ; i < dependencies . length ; i ++ ) {
var is _unowned _connected = is _unowned && active _effect !== null && ! skip _reaction ;
( dependencies [ i ] . reactions ? ? = [ ] ) . push ( reaction ) ;
var length = dependencies . length ;
// If we are working with a disconnected or an unowned signal that is now connected (due to an active effect)
// then we need to re-connect the reaction to the dependency
if ( is _disconnected || is _unowned _connected ) {
for ( i = 0 ; i < length ; i ++ ) {
dependency = dependencies [ i ] ;
if ( ! dependency ? . reactions ? . includes ( reaction ) ) {
( dependency . reactions ? ? = [ ] ) . push ( reaction ) ;
}
}
}
reaction . f ^= DISCONNECTED ;
if ( is _disconnected ) {
reaction . f ^= DISCONNECTED ;
}
}
}
for ( i = 0 ; i < dependencies . length ; i ++ ) {
for ( i = 0 ; i < length; i ++ ) {
var dependency = dependencies [ i ] ;
dependency = dependencies [ i ] ;
if ( check _dirtiness ( /** @type {Derived} */ ( dependency ) ) ) {
if ( check _dirtiness ( /** @type {Derived} */ ( dependency ) ) ) {
update _derived ( /** @type {Derived} */ ( dependency ) ) ;
update _derived ( /** @type {Derived} */ ( dependency ) ) ;
}
}
// If we are working with an unowned signal as part of an effect (due to !skip_reaction)
// and the version hasn't changed, we still need to check that this reaction
// is linked to the dependency source – otherwise future updates will not be caught.
if (
is _unowned &&
active _effect !== null &&
! skip _reaction &&
! dependency ? . reactions ? . includes ( reaction )
) {
( dependency . reactions ? ? = [ ] ) . push ( reaction ) ;
}
if ( dependency . version > reaction . version ) {
if ( dependency . version > reaction . version ) {
return true ;
return true ;
}
}