It would be quite convenient if we could easily remove branches of the state tree by simply calling node.$destroy().
If node is a child of an object, the operation would be delete parent[nodeProp]. In case the node is an array item, the operation can be fulfilled by Array.splice.
Remove elements from arrays is a common operation in React apps which should make a case for this API. Removing props from objects seems a little less common, but could still be handy should the user decide to build normalized key/value stores.
It would be quite convenient if we could easily remove branches of the state tree by simply calling
node.$destroy()
.If
node
is a child of an object, the operation would bedelete parent[nodeProp]
. In case the node is an array item, the operation can be fulfilled byArray.splice
.Remove elements from arrays is a common operation in React apps which should make a case for this API. Removing props from objects seems a little less common, but could still be handy should the user decide to build normalized key/value stores.