some comments
This commit is contained in:
parent
921c205e22
commit
32bd9f2601
|
@ -99,6 +99,7 @@ const areTreeNodesEqual = (children1, children2) => {
|
||||||
|
|
||||||
let isEqual = false
|
let isEqual = false
|
||||||
for (let i = 0; i < children1.length; i++) {
|
for (let i = 0; i < children1.length; i++) {
|
||||||
|
// same context and same children, then nothing has changed
|
||||||
isEqual =
|
isEqual =
|
||||||
deepEqual(children1[i].context, children2[i].context) &&
|
deepEqual(children1[i].context, children2[i].context) &&
|
||||||
areTreeNodesEqual(children1[i].children, children2[i].children)
|
areTreeNodesEqual(children1[i].children, children2[i].children)
|
||||||
|
|
|
@ -79,6 +79,7 @@ export const createTreeNode = () => ({
|
||||||
const node = this
|
const node = this
|
||||||
return () => {
|
return () => {
|
||||||
if (node.children) {
|
if (node.children) {
|
||||||
|
// destroy children first - from leaf nodes up
|
||||||
for (let child of node.children) {
|
for (let child of node.children) {
|
||||||
child.destroy()
|
child.destroy()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue