@ -84,8 +84,8 @@ export function set_active_effect(effect) {
/ * *
/ * *
* When sources are created within a reaction , reading and writing
* When sources are created within a reaction , reading and writing
* them should not cause a re - run
* them within that reaction should not cause a re - run
* @ type { null | Source [ ] }
* @ type { null | [ active _reaction : Reaction , sources : Source [ ] ] }
* /
* /
export let reaction _sources = null ;
export let reaction _sources = null ;
@ -93,9 +93,9 @@ export let reaction_sources = null;
export function push _reaction _value ( value ) {
export function push _reaction _value ( value ) {
if ( active _reaction !== null && active _reaction . f & EFFECT _IS _UPDATING ) {
if ( active _reaction !== null && active _reaction . f & EFFECT _IS _UPDATING ) {
if ( reaction _sources === null ) {
if ( reaction _sources === null ) {
reaction _sources = [ value] ;
reaction _sources = [ active_reaction , [ value] ] ;
} else {
} else {
reaction _sources .push ( value ) ;
reaction _sources [1 ] .push ( value ) ;
}
}
}
}
}
}
@ -234,7 +234,7 @@ function schedule_possible_effect_self_invalidation(signal, effect, root = true)
for ( var i = 0 ; i < reactions . length ; i ++ ) {
for ( var i = 0 ; i < reactions . length ; i ++ ) {
var reaction = reactions [ i ] ;
var reaction = reactions [ i ] ;
if ( reaction _sources ? . includes ( signal ) ) continue ;
if ( reaction _sources ? . [ 1 ] . includes ( signal ) && reaction _sources [ 0 ] === active _reaction ) continue ;
if ( ( reaction . f & DERIVED ) !== 0 ) {
if ( ( reaction . f & DERIVED ) !== 0 ) {
schedule _possible _effect _self _invalidation ( /** @type {Derived} */ ( reaction ) , effect , false ) ;
schedule _possible _effect _self _invalidation ( /** @type {Derived} */ ( reaction ) , effect , false ) ;
@ -724,7 +724,7 @@ export function get(signal) {
// Register the dependency on the current reaction signal.
// Register the dependency on the current reaction signal.
if ( active _reaction !== null && ! untracking ) {
if ( active _reaction !== null && ! untracking ) {
if ( ! reaction _sources ? . includes ( signal ) ) {
if ( ! reaction _sources ? . [ 1 ] . includes ( signal ) || reaction _sources [ 0 ] !== active _reaction ) {
var deps = active _reaction . deps ;
var deps = active _reaction . deps ;
if ( signal . rv < read _version ) {
if ( signal . rv < read _version ) {
signal . rv = read _version ;
signal . rv = read _version ;