Make index of Node readonly to prevent potential remove child with complexity o(n^2)
Note that Konva.Container#removeChildren function comment with these line
reset parent to prevent many _setChildrenIndices calls
That means without reset the parent, Konva.Node#remove would call _setChildrenIndice which will take into extra o(n^2) complexity. It works in this case but failed in other case such as call remove node in a certain loop, which offen ocurrs in increasing draw visible node and decreasing destory invisible node in current viewport.
Thus replace the index property with readonly index is a better way to prevent the unexpected complextiy by frequent operation of a Konva Node.
Make index of Node readonly to prevent potential remove child with complexity o(n^2)
Note that Konva.Container#removeChildren function comment with these line
That means without reset the parent, Konva.Node#remove would call _setChildrenIndice which will take into extra o(n^2) complexity. It works in this case but failed in other case such as call remove node in a certain loop, which offen ocurrs in increasing draw visible node and decreasing destory invisible node in current viewport.
Thus replace the index property with readonly index is a better way to prevent the unexpected complextiy by frequent operation of a Konva Node.