-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Introduce dynamicObject
for dynamically keyed objects in Proxy supporting environments
#652
Comments
dynamicObject
for dynamically keyed objects in Proxy supporting environmentsdynamicObject
for dynamically keyed objects in Proxy supporting environments
Did anyone start working on this yet? |
I have #776 with pending tasks, but it's not going to get any serious boost from my end |
Hi @mweststrate , I implemented mobx in proxy, although not all of the API has been implemented, but the core functionality has been opened and has passed 50 unit tests and has been run online. code: https://github.com/ascoders/dynamic-object |
And implemented a similar mobx-react called dynamic-react, i wish I could merge into mobx |
See also #336
Introduce
object = dynamicObject(object)
and implement that using ES6 proxies. This allows plain objects to be used as observable objects, without the current limitation of not supporting dynamic keys.I think that is a nice case to start working with Proxies, learn about their caveats, performance etc. It has a clear use case and advantage over the current getter / setter implementation, yet there is a fallback for those needing to support browsers without proxies (probably the most of us):
ObservableMaps
Example:
Should throw clear error if proxies (or too limited polyfill) are not available at runtime and hint at using ObservableMaps instead
The text was updated successfully, but these errors were encountered: