google / incremental-dom

An in-place DOM diffing library
http://google.github.io/incremental-dom/
Apache License 2.0
3.54k stars 180 forks source link

Create the ability to patch a range #321

Open sparhami opened 7 years ago

sparhami commented 7 years ago

In some situations, you want to patch a range of DOM rather than just an Element or its children. This could allow for a function rendering one or more nodes to re-render the same part of the DOM without needing a wrapping container by keeping track of where it started rendering and where it ended.

The function signature might look like patchRange(startNode, endNode, fn, data). This function is similar to patchOuter, which is a special case where the range is just a single node and extra nodes are not allowed to be patched in.