|
1 | 1 | /** @import { Effect, TemplateNode } from '#client' */ |
2 | 2 | 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'; |
4 | 4 | import { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js'; |
5 | 5 | import { create_fragment_from_html } from '../reconciler.js'; |
6 | 6 | import { assign_nodes } from '../template.js'; |
@@ -49,9 +49,12 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning |
49 | 49 | /** @type {Effect | undefined} */ |
50 | 50 | var effect; |
51 | 51 |
|
52 | | - var boundary = find_boundary(active_effect); |
| 52 | + template_effect(() => { |
| 53 | + if (value === (value = get_value() ?? '')) { |
| 54 | + if (hydrating) hydrate_next(); |
| 55 | + return; |
| 56 | + } |
53 | 57 |
|
54 | | - function commit() { |
55 | 58 | if (effect !== undefined) { |
56 | 59 | destroy_effect(effect); |
57 | 60 | effect = undefined; |
@@ -115,18 +118,5 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning |
115 | 118 | anchor.before(node); |
116 | 119 | } |
117 | 120 | }); |
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 | | - } |
131 | 121 | }); |
132 | 122 | } |
0 commit comments