1
0
Fork 0
mirror of synced 2024-10-01 09:38:55 +13:00

some comments

This commit is contained in:
Michael Shanks 2020-07-07 10:51:25 +01:00
parent 921c205e22
commit 32bd9f2601
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()
}