Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support #destroy operation #55

Open
drborges opened this issue Apr 17, 2021 · 0 comments
Open

Support #destroy operation #55

drborges opened this issue Apr 17, 2021 · 0 comments
Labels

Comments

@drborges
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant