|
9 | 9 | children, |
10 | 10 | } from './ish.js'; |
11 | 11 |
|
| 12 | +import { Signal } from './signals.js'; |
12 | 13 | import { Unsafe, assign, entries, isArray } from '../utils.js'; |
13 | 14 | import { PersistentFragment, diffFragment, nodes } from './persistent-fragment.js'; |
14 | 15 | import creator from './creator.js'; |
@@ -72,6 +73,10 @@ const comment_unsafe = xml => (node, value) => { |
72 | 73 | comment_hole(node, PersistentFragment(fragment(value, xml))); |
73 | 74 | }; |
74 | 75 |
|
| 76 | +const comment_signal = (node, value) => { |
| 77 | + comment_hole(node, value instanceof Signal ? value.value : value); |
| 78 | +}; |
| 79 | + |
75 | 80 | const data = ({ dataset }, values) => { |
76 | 81 | for (const [key, value] of entries(values)) { |
77 | 82 | if (value == null) delete dataset[key]; |
@@ -135,7 +140,7 @@ export const update = (node, type, path, name, hint) => { |
135 | 140 | if (isArray(hint)) return [path, comment_array, COMMENT_ARRAY]; |
136 | 141 | return hint instanceof Unsafe ? |
137 | 142 | [path, comment_unsafe(node.xml), UNSAFE] : |
138 | | - [path, comment_hole, COMMENT] |
| 143 | + [path, hint instanceof Signal ? comment_signal : comment_hole, COMMENT] |
139 | 144 | ; |
140 | 145 | } |
141 | 146 | case TEMPLATE_TEXT: return [path, directFor('textContent'), TEXT]; |
|
0 commit comments