Merge branch 'async-fixes' into async-fixes-2

async-fixes-2
Rich Harris 2 months ago
commit ab740c954d

@ -472,12 +472,15 @@ export function flushSync(fn) {
batch.flush(); batch.flush();
} }
// TODO this feels wrong
if (queued_root_effects.length === 0) {
// this would be reset in `batch.flush_effects()` but since we are early returning here, // this would be reset in `batch.flush_effects()` but since we are early returning here,
// we need to reset it here as well in case the first time there's 0 queued root effects // we need to reset it here as well in case the first time there's 0 queued root effects
last_scheduled_effect = null; last_scheduled_effect = null;
return /** @type {T} */ (result); return /** @type {T} */ (result);
} }
}
batch.flush_effects(); batch.flush_effects();
} }

Loading…
Cancel
Save