pull/16482/head
Rich Harris 1 month ago
parent f1f34f7382
commit 10b2d64e0c

@ -450,8 +450,6 @@ export function flushSync(fn) {
try { try {
var result; var result;
var batch = Batch.ensure();
if (fn) { if (fn) {
flush_effects(); flush_effects();
result = fn(); result = fn();
@ -461,10 +459,7 @@ export function flushSync(fn) {
flush_tasks(); flush_tasks();
if (queued_root_effects.length === 0) { if (queued_root_effects.length === 0) {
// TODO this might need adjustment current_batch?.flush();
if (batch === current_batch) {
batch.flush();
}
// TODO this feels wrong // TODO this feels wrong
if (queued_root_effects.length === 0) { if (queued_root_effects.length === 0) {
@ -492,7 +487,7 @@ function flush_effects() {
set_is_updating_effect(true); set_is_updating_effect(true);
while (queued_root_effects.length > 0) { while (queued_root_effects.length > 0) {
var batch = /** @type {Batch} */ (current_batch); var batch = Batch.ensure();
if (flush_count++ > 1000) { if (flush_count++ > 1000) {
if (DEV) { if (DEV) {

Loading…
Cancel
Save