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

set function not called on default values #87

Closed
green3g opened this issue Nov 3, 2016 · 0 comments · Fixed by #130
Closed

set function not called on default values #87

green3g opened this issue Nov 3, 2016 · 0 comments · Fixed by #130
Assignees
Labels

Comments

@green3g
Copy link

green3g commented Nov 3, 2016

In the previous version of canjs, setting a default value in a define object would automatically call a set function on that property, even if the constructor doesn't receive the property.

http://jsbin.com/wicuguwisa/edit?html,js,console,output

In the new version, there are probably some changes to how this is set up, because default values do not call the set property. But, if the DefineMap's constructor is passed this property, the set function is called.

http://jsbin.com/kepixenonu/edit?html,js,console,output

It would still be ideal to keep this functionality. I like to use setters to trigger updates to other fields when a value is set whether its set when the map is created using a default value or whether its set by passing the property to the constructor.

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

Successfully merging a pull request may close this issue.

2 participants