|
|
|
|
|
by lhorie
3026 days ago
|
|
> The only option is to run the code above again, in its entirety Not at all. The reactive pattern typically boils down to something like this: el = document.createTextNode(initialValue);
parent.appendChild(el);
reactiveValue.onchange(v => {
el.nodeValue = v;
})
Ironically, in this specific example, vdom libs typically do this when possible: parent.textContent = v
which does in fact replace the underlying text node, but they do so for the sake of performance |
|