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

Bugfix: createViewModel to honor the non-enumerability of a property #169

Merged

Conversation

dr0p
Copy link
Contributor

@dr0p dr0p commented Jan 4, 2019

It is quite common pattern (at least in our projects) to have a non enumerable properties that use spread to access this. When createViewModel is used to create a view model of such object, the non-enumerability of the property is lost and usage if spread operator or Object.entries on this causes a cycle in the mobx computation. The small change here propagates the enumerability of the models' property to the newly created view model.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.094% when pulling 9aebd22 on dr0p:bugfix/honor-enumerable-property-descriptor into 09a51bc on mobxjs:master.

@mweststrate
Copy link
Member

Good catch, thanks!

@mweststrate mweststrate merged commit c1d82ef into mobxjs:master Jan 4, 2019
@mweststrate
Copy link
Member

Released as 5.2.0

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

Successfully merging this pull request may close these issues.

3 participants