@@ -261,6 +261,20 @@ function mark_reactions(signal, status) {
261261 var reaction = reactions [ i ] ;
262262 var flags = reaction . f ;
263263
264+ if ( ( flags & LAZY_EFFECT ) !== 0 ) {
265+ var effect = /** @type {Effect } */ ( reaction ) ;
266+ var deriveds = effect . deriveds ;
267+ if ( deriveds !== null ) {
268+ for ( let i = 0 ; i < deriveds . length ; i ++ ) {
269+ var derived = deriveds [ i ] ;
270+ if ( derived . parent !== effect ) {
271+ set_signal_status ( derived , DIRTY ) ;
272+ mark_reactions ( derived , MAYBE_DIRTY ) ;
273+ }
274+ }
275+ }
276+ }
277+
264278 // Skip any effects that are already dirty
265279 if ( ( flags & DIRTY ) !== 0 ) continue ;
266280
@@ -280,19 +294,8 @@ function mark_reactions(signal, status) {
280294 if ( ( flags & DERIVED ) !== 0 ) {
281295 mark_reactions ( /** @type {Derived } */ ( reaction ) , MAYBE_DIRTY ) ;
282296 } else {
283- var effect = /** @type {Effect } */ ( reaction ) ;
297+ effect = /** @type {Effect } */ ( reaction ) ;
284298 schedule_effect ( effect ) ;
285-
286- if ( ( flags & LAZY_EFFECT ) !== 0 ) {
287- var deriveds = /** @type {Derived[] } */ ( effect . deriveds ) ;
288- for ( let i = 0 ; i < deriveds . length ; i ++ ) {
289- var derived = deriveds [ i ] ;
290- if ( derived . parent !== effect ) {
291- set_signal_status ( derived , DIRTY ) ;
292- mark_reactions ( derived , MAYBE_DIRTY ) ;
293- }
294- }
295- }
296299 }
297300 }
298301 }
0 commit comments