2 ms·
> As we said before the h returns a memory address. This means that this memory have to be deleted manually, as we have to do in C++ for example. By default asm
by amelius 10y ago
> As we said before the h returns a memory address. This means that this memory have to be deleted manually, as we have to do in C++ for example. By default asm-dom automatically delete the old vnode from memory when patch is called.
So may there be structural sharing across vdom trees? Or within a tree?
- mbasso 10y agoYes! h always returns a memory address to a VNode. In C++ this address is reinterpreted in a VNode, that contains others VNode as children. If you decide to manually manage the memory, you can implement some interesting mechanism to diff vnodes and create vdom trees. To do this, I have to develop some APIs that allows you, for example, to replace a children with another and so on. This is certainly on the roadmap!