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

Object.defineProperty should trigger reactions #44

Open
robbiewxyz opened this issue Sep 21, 2019 · 3 comments
Open

Object.defineProperty should trigger reactions #44

robbiewxyz opened this issue Sep 21, 2019 · 3 comments

Comments

@robbiewxyz
Copy link

Setting a new value or a new get function using Object.defineProperty should trigger reactions on the relevant key. This should support reacting to both modifying existing keys of and adding new keys to an object.

This would require adding a new Proxy trap and writing tests for the new behavior.

I'm willing and able to help put together a pull request.

Any thoughts?

@solkimicreb
Copy link
Member

I am not sure about that. There are a few get and set like operations that are not covered by design: https://itnext.io/the-ideas-behind-react-easy-state-901d70e4d03e. Object.defineProperty is one of them. I think it is too meta level, we can revise this though.

Did you get into a use case where this behavior surprised you or did you make this suggestion based on the source code?

@robbiewxyz
Copy link
Author

robbiewxyz commented Mar 6, 2020 via email

@robbiewxyz
Copy link
Author

robbiewxyz commented Mar 6, 2020 via email

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

No branches or pull requests

2 participants