experiment_s
Rich Harris 22 hours ago
parent 4ef2be3a5d
commit 278c49056d

@ -111,6 +111,10 @@ export function boundary(node, props, boundary_fn) {
if (suspend_count++ === 0) {
queue_micro_task(() => {
if (suspended_effect) {
return;
}
var effect = boundary_effect;
suspended_effect = boundary_effect;
@ -149,14 +153,20 @@ export function boundary(node, props, boundary_fn) {
return false;
}
if (--suspend_count === 0 && suspended_effect !== null) {
if (boundary_effect) {
destroy_effect(boundary_effect);
}
boundary_effect = suspended_effect;
suspended_effect = null;
anchor.before(/** @type {DocumentFragment} */ (suspended_fragment));
resume_effect(boundary_effect);
if (--suspend_count === 0) {
queue_micro_task(() => {
if (!suspended_effect) {
return;
}
if (boundary_effect) {
destroy_effect(boundary_effect);
}
boundary_effect = suspended_effect;
suspended_effect = null;
anchor.before(/** @type {DocumentFragment} */ (suspended_fragment));
resume_effect(boundary_effect);
});
}
return true;

Loading…
Cancel
Save