Matt-Esch/virtual-dom

shouldDestroy Widget Hook

MadMub opened this issue · 0 comments

I've recently been trying to upgrade a rails app to feel modern using some experimental tech, I got very far with virtual-dom, unfortunately though I need a way of persisting dynamically added dom to the page. the concept of Widgets gave me hope, when i ajax'ed for a page refresh I was able to hook into Widget#destroy, but unfortunately that callback does not help (can't stop the domNode from being removed), what I need is for a way to tell the diffing algorithm to leave this section of vdom alone even if its pegged for removal.

My goal is to avoid dirty hacks like persisting a bunch of stateful widgets in a temporary hash, and re initing/adding them to the dom on every diff and patch.

I hope this feature request is feasible and fits within the scope of the project.