Skip to content

Commit 70fa103

Browse files
committed
simplify
1 parent ffc4f1b commit 70fa103

File tree

1 file changed

+6
-16
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+6
-16
lines changed

packages/svelte/src/internal/client/dom/blocks/html.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @import { Effect, TemplateNode } from '#client' */
22
import { FILENAME, HYDRATION_ERROR } from '../../../../constants.js';
3-
import { block, branch, destroy_effect } from '../../reactivity/effects.js';
3+
import { block, branch, destroy_effect, template_effect } from '../../reactivity/effects.js';
44
import { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';
55
import { create_fragment_from_html } from '../reconciler.js';
66
import { assign_nodes } from '../template.js';
@@ -49,9 +49,12 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning
4949
/** @type {Effect | undefined} */
5050
var effect;
5151

52-
var boundary = find_boundary(active_effect);
52+
template_effect(() => {
53+
if (value === (value = get_value() ?? '')) {
54+
if (hydrating) hydrate_next();
55+
return;
56+
}
5357

54-
function commit() {
5558
if (effect !== undefined) {
5659
destroy_effect(effect);
5760
effect = undefined;
@@ -115,18 +118,5 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning
115118
anchor.before(node);
116119
}
117120
});
118-
}
119-
120-
block(() => {
121-
if (value === (value = get_value() ?? '')) {
122-
if (hydrating) hydrate_next();
123-
return;
124-
}
125-
126-
if (suspended) {
127-
add_boundary_callback(boundary, commit);
128-
} else {
129-
commit();
130-
}
131121
});
132122
}

0 commit comments

Comments
 (0)