You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi - I'm using diff.diffNode() and dom.update() directly.
I've noticed if I pass two vNodes with identical structure to diff.diffNode(), I still get back a complicated tree of changes full of updateChildren and updateChild changes (with the final result being a no-op).
I would like to easily detect when diff.diffNode() reports there are no changes. While I can walk the tree and figure it out, it seems more efficient if diff.diffNode() (and `diff.diffChildren()') simply returned an empty array in this scenario.
It seems this can fairly easily be done by something like the following change when returning from diffChildren():
Hi - I'm using
diff.diffNode()
anddom.update()
directly.I've noticed if I pass two
vNodes
with identical structure todiff.diffNode()
, I still get back a complicated tree of changes full ofupdateChildren
andupdateChild
changes (with the final result being a no-op).I would like to easily detect when
diff.diffNode()
reports there are no changes. While I can walk the tree and figure it out, it seems more efficient ifdiff.diffNode()
(and `diff.diffChildren()') simply returned an empty array in this scenario.It seems this can fairly easily be done by something like the following change when returning from
diffChildren()
:And in the
isNative
case when returning fromdiffNode()
:Similar changes would probably be needed for thunks (but I'm not currently using them so I haven't looked at that).
So I'm wondering - is there some philosophical reason not to just return an empty array in these scenarios?
The text was updated successfully, but these errors were encountered: