some comments

This commit is contained in:
Michael Shanks 2020-07-07 10:51:25 +01:00
parent 9424cbb615
commit 94509a814d
2 changed files with 2 additions and 0 deletions

View File

@ -99,6 +99,7 @@ const areTreeNodesEqual = (children1, children2) => {
let isEqual = false
for (let i = 0; i < children1.length; i++) {
// same context and same children, then nothing has changed
isEqual =
deepEqual(children1[i].context, children2[i].context) &&
areTreeNodesEqual(children1[i].children, children2[i].children)

View File

@ -79,6 +79,7 @@ export const createTreeNode = () => ({
const node = this
return () => {
if (node.children) {
// destroy children first - from leaf nodes up
for (let child of node.children) {
child.destroy()
}