this fixes the last test somehow

async-fixes-2^2
Simon Holthausen 2 months ago
parent 4cb484709f
commit 9e54e9ae20

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

Loading…
Cancel
Save