aa-fork
Rich Harris 8 months ago
parent 5294730486
commit 51a3d1e4bd

@ -70,11 +70,11 @@ export function if_block(node, fn, elseif = false) {
active_fork.f ^= FORK_ROOT;
const fragment = document.createDocumentFragment();
const offscreen_condition = condition;
const offscreen_anchor = document.createComment('');
fragment.append(offscreen_anchor);
try {
const offscreen_effect = fn && branch(() => fn(offscreen_anchor));
active_fork.branches.push(() => {
@ -106,6 +106,9 @@ export function if_block(node, fn, elseif = false) {
}
}
});
} finally {
active_fork.f |= FORK_ROOT;
}
return;
}

@ -145,6 +145,10 @@ export function fork(fn) {
flush_sync();
revert(active_fork);
if (f.pending === 0) {
f.callback();
}
});
} finally {
active_fork = null;

Loading…
Cancel
Save