@@ -97,7 +97,7 @@ export class Batch {
9797 process_effects ( this , root ) ;
9898 }
9999
100- if ( this . async_effects . length === 0 && this . settled ( ) ) {
100+ if ( this . async_effects . length === 0 && this . #pending === 0 ) {
101101 var merged = false ;
102102
103103 // if there are older batches with overlapping
@@ -191,25 +191,6 @@ export class Batch {
191191
192192 remove ( ) {
193193 batches . delete ( this ) ;
194-
195- // for (var batch of batches) {
196- // /** @type {Source } */
197- // var source;
198-
199- // if (batch.#id < this.#id) {
200- // // other batch is older than this
201- // for (source of this.#previous.keys()) {
202- // batch.#previous.delete(source);
203- // }
204- // } else {
205- // // other batch is newer than this
206- // for (source of batch.#previous.keys()) {
207- // if (this.#previous.has(source)) {
208- // batch.#previous.set(source, source.v);
209- // }
210- // }
211- // }
212- // }
213194 }
214195
215196 restore ( ) {
@@ -223,15 +204,14 @@ export class Batch {
223204 return ;
224205 }
225206
226- if ( this . settled ( ) ) {
207+ if ( this . #pending === 0 ) {
227208 this . remove ( ) ;
228209 }
229210
230211 current_batch = null ;
231212 }
232213
233214 commit ( ) {
234- // commit changes
235215 for ( const fn of this . #callbacks) {
236216 fn ( ) ;
237217 }
@@ -266,10 +246,6 @@ export class Batch {
266246 }
267247 }
268248
269- settled ( ) {
270- return this . #pending === 0 ;
271- }
272-
273249 /** @param {() => void } fn */
274250 add_callback ( fn ) {
275251 this . #callbacks. add ( fn ) ;
0 commit comments