I am working on a project where I use diffDOM to update the DOM based on state changes. I have encountered a situation where oldDom and newDom can have completely different sets of initial child nodes, and I need to selectively ignore diffs for a variable number of these initial children when creating and applying diffs.
My main challenge is that the number of children to be ignored is not constant and cannot be determined upfront. This variability makes it difficult to use a static filtering approach.
Here is an example scenario:
oldDom has a list of child nodes, some of which have been dynamically added or removed when the next state is generated
newDom reflects another state of the same page, with its own set of potentially new child nodes that should be compared to oldDom
- I need to compare
oldDom and newDom and generate diffs for all nodes except the initial children that differ in a way that's unpredictable
I'm seeking advice or a possible feature that could assist in the following:
- Ignoring diffs generated for a subset of child nodes without a pre-known fixed index (the child nodes to be skipped have specific classes)
- Applying diffs to
oldDom while skipping over the aforementioned nodes to reflect changes in newDom correctly (the child nodes to be skipped have specific classes)
Could you please provide some guidance or recommend an approach to achieve this with diffDOM? Any help or pointers towards relevant parts of the documentation would be greatly appreciated.
Thank you for your time and for maintaining this useful library.
I am working on a project where I use diffDOM to update the DOM based on state changes. I have encountered a situation where
oldDomandnewDomcan have completely different sets of initial child nodes, and I need to selectively ignore diffs for a variable number of these initial children when creating and applying diffs.My main challenge is that the number of children to be ignored is not constant and cannot be determined upfront. This variability makes it difficult to use a static filtering approach.
Here is an example scenario:
oldDomhas a list of child nodes, some of which have been dynamically added or removed when the next state is generatednewDomreflects another state of the same page, with its own set of potentially new child nodes that should be compared tooldDomoldDomandnewDomand generate diffs for all nodes except the initial children that differ in a way that's unpredictableI'm seeking advice or a possible feature that could assist in the following:
oldDomwhile skipping over the aforementioned nodes to reflect changes innewDomcorrectly (the child nodes to be skipped have specific classes)Could you please provide some guidance or recommend an approach to achieve this with diffDOM? Any help or pointers towards relevant parts of the documentation would be greatly appreciated.
Thank you for your time and for maintaining this useful library.