aa-coordination
Rich Harris 8 months ago
parent 4642b499bb
commit 2c557b6cd8

@ -9,6 +9,8 @@ import { hash, sanitize_location } from '../../../../utils.js';
import { DEV } from 'esm-env'; import { DEV } from 'esm-env';
import { dev_current_component_function } from '../../context.js'; import { dev_current_component_function } from '../../context.js';
import { get_first_child, get_next_sibling } from '../operations.js'; import { get_first_child, get_next_sibling } from '../operations.js';
import { active_effect, suspended } from '../../runtime.js';
import { add_boundary_callback, find_boundary } from './boundary.js';
/** /**
* @param {Element} element * @param {Element} element
@ -47,14 +49,9 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning
/** @type {Effect | undefined} */ /** @type {Effect | undefined} */
var effect; var effect;
block(() => { var boundary = find_boundary(active_effect);
if (value === (value = get_value() ?? '')) {
if (hydrating) {
hydrate_next();
}
return;
}
function commit() {
if (effect !== undefined) { if (effect !== undefined) {
destroy_effect(effect); destroy_effect(effect);
effect = undefined; effect = undefined;
@ -118,5 +115,18 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning
anchor.before(node); anchor.before(node);
} }
}); });
}
block(() => {
if (value === (value = get_value() ?? '')) {
if (hydrating) hydrate_next();
return;
}
if (suspended) {
add_boundary_callback(boundary, commit);
} else {
commit();
}
}); });
} }

Loading…
Cancel
Save