yelouafi / petit-dom

minimalist virtual dom library
MIT License
506 stars 36 forks source link

Possibility to calculate diff without applying the changes (patching) to the dom #5

Open cjh9 opened 6 years ago

cjh9 commented 6 years ago

I would like to calculate the diff between two trees, without patching, because it will be done in a webworker (without access to the DOM).

Similarly to what is done here: https://github.com/Matt-Esch/virtual-dom

var patches = diff(tree, newTree);
rootNode = patch(rootNode, patches);

Can this be done in this vdom implementation?

yelouafi commented 6 years ago

Actually not. But I think defintely worth adding it