@@ -34,15 +34,14 @@ import {
3434 EFFECT_PRESERVED ,
3535 STALE_REACTION
3636} from '#client/constants' ;
37- import { set } from './sources.js' ;
3837import * as e from '../errors.js' ;
3938import { DEV } from 'esm-env' ;
4039import { define_property } from '../../shared/utils.js' ;
4140import { get_next_sibling } from '../dom/operations.js' ;
4241import { async_derived , derived } from './deriveds.js' ;
43- import { capture , get_pending_boundary } from '../dom/blocks/boundary.js' ;
42+ import { capture } from '../dom/blocks/boundary.js' ;
4443import { component_context , dev_current_component_function } from '../context.js' ;
45- import { current_batch , Batch } from './batch.js' ;
44+ import { Batch } from './batch.js' ;
4645
4746/**
4847 * @param {'$effect' | '$effect.pre' | '$inspect' } rune
@@ -343,24 +342,13 @@ export function template_effect(fn, sync = [], async = [], d = derived) {
343342 var parent = /** @type {Effect } */ ( active_effect ) ;
344343
345344 if ( async . length > 0 ) {
346- var batch = /** @type {Batch } */ ( current_batch ) ;
347345 var restore = capture ( ) ;
348346
349- var boundary = get_pending_boundary ( ) ;
350- var ran = boundary . ran ;
351-
352347 Promise . all ( async . map ( ( expression ) => async_derived ( expression ) ) ) . then ( ( result ) => {
353- restore ( ) ;
354-
355- if ( ( parent . f & DESTROYED ) !== 0 ) {
356- return ;
357- }
358-
359- var effect = create_template_effect ( fn , [ ...sync . map ( d ) , ...result ] ) ;
348+ if ( ( parent . f & DESTROYED ) !== 0 ) return ;
360349
361- if ( ran ) batch . restore ( ) ;
362- schedule_effect ( effect ) ;
363- if ( ran ) batch . flush ( ) ;
350+ restore ( ) ;
351+ create_template_effect ( fn , [ ...sync . map ( d ) , ...result ] ) ;
364352 } ) ;
365353 } else {
366354 create_template_effect ( fn , sync . map ( d ) ) ;
@@ -380,7 +368,7 @@ function create_template_effect(fn, deriveds) {
380368 } ) ;
381369 }
382370
383- return create_effect ( RENDER_EFFECT , effect , true ) ;
371+ create_effect ( RENDER_EFFECT , effect , true ) ;
384372}
385373
386374/**
0 commit comments