The wire is different from bind because it lives outside the live DOM.
There are cases where a wire could produce a fragment instead of a single node.
In the latter scenario, the node won't leave the DOM with successful updates.
However, when it's a fragment, all childrewn are re-appended each time
to grant the slot associated to the fragmnent will always have expected children.
However, there are cases where a wire is needed for a single element or component,
where nodes should be appended once and never again.
In such case, it is always possible to use valueOf(false) or just .valueOf()
to be sure that nodes won't ever leave again the DOM.
Using valueOf() is safe for any returned DOM node too since it's returning just itself.
Pleaase see the test/haunted.html and debug the nodes to see why this is needed,
switching between valueOf() and valueOf(true).
The wire is different from bind because it lives outside the live DOM.
There are cases where a wire could produce a fragment instead of a single node. In the latter scenario, the node won't leave the DOM with successful updates. However, when it's a fragment, all childrewn are re-appended each time to grant the slot associated to the fragmnent will always have expected children.
However, there are cases where a wire is needed for a single element or component, where nodes should be appended once and never again.
In such case, it is always possible to use
valueOf(false)
or just.valueOf()
to be sure that nodes won't ever leave again the DOM.Using
valueOf()
is safe for any returned DOM node too since it's returning just itself.Pleaase see the
test/haunted.html
and debug the nodes to see why this is needed, switching betweenvalueOf()
andvalueOf(true)
.