@@ -158,27 +158,17 @@ export class Batch {
158158
159159 // if there is no outstanding async work, commit
160160 if ( this . #pending === 0 ) {
161- // TODO we need this because we commit _then_ flush effects...
162- // maybe there's a way we can reverse the order?
163- // var previous_batch_sources = batch_values;
164-
161+ // commit before flushing effects, since that may result in
162+ // another batch being created
165163 this . #commit( ) ;
166-
167- // batch_values = previous_batch_sources;
168- // flush_queued_effects(target.render_effects);
169- // flush_queued_effects(target.effects);
170- } else {
171- // this.#defer_effects(target.render_effects);
172- // this.#defer_effects(target.effects);
173- // this.#defer_effects(target.block_effects);
174164 }
175165
176166 if ( this . #blocking_pending > 0 ) {
177167 this . #defer_effects( target . effects ) ;
178168 this . #defer_effects( target . render_effects ) ;
179169 this . #defer_effects( target . block_effects ) ;
180170 } else {
181- // TODO append/detach blocks here as well , not in #commit
171+ // TODO append/detach blocks here, not in #commit
182172
183173 // If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with
184174 // newly updated sources, which could lead to infinite loops when effects run over and over again.
0 commit comments