Skip to content

Commit 8b87563

Browse files
committed
move some code around
1 parent 1ab675f commit 8b87563

File tree

1 file changed

+12
-11
lines changed
  • packages/svelte/src/internal/client/reactivity

1 file changed

+12
-11
lines changed

packages/svelte/src/internal/client/reactivity/batch.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ export class Batch {
178178
flush_queued_effects(render_effects);
179179
flush_queued_effects(effects);
180180

181+
previous_batch = null;
182+
181183
this.#deferred?.resolve();
182184
} else {
183185
this.#defer_effects(this.#render_effects);
@@ -280,17 +282,6 @@ export class Batch {
280282

281283
deactivate() {
282284
current_batch = null;
283-
previous_batch = null;
284-
285-
for (const update of effect_pending_updates) {
286-
effect_pending_updates.delete(update);
287-
update();
288-
289-
if (current_batch !== null) {
290-
// only do one at a time
291-
break;
292-
}
293-
}
294285
}
295286

296287
flush() {
@@ -307,6 +298,16 @@ export class Batch {
307298
}
308299

309300
this.deactivate();
301+
302+
for (const update of effect_pending_updates) {
303+
effect_pending_updates.delete(update);
304+
update();
305+
306+
if (current_batch !== null) {
307+
// only do one at a time
308+
break;
309+
}
310+
}
310311
}
311312

312313
/**

0 commit comments

Comments
 (0)