-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use new getter/setter for computed if available #2961
Conversation
👍 |
if (arguments.length > 1) { | ||
return computedConfig.set.call(this, key, value); | ||
} | ||
return computedConfig.get.call(this, key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move this logic into a shared util helper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered using https://github.com/rwjblue/ember-new-computed/blob/master/addon/index.js from @rwjblue but didn't know if it was worth it since we only have settable CPs in these two places in ED. If we use a helper like the one linked we should probably make sure that we use it everywhere within ED.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, I'm happy to make it a shared helper too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are already putting supportsComputedGetterSetter
into a shared util, but it's only used as part of this function, we should probably move this into the util as well.
3da44fc
to
c5c0861
Compare
c5c0861
to
c53815f
Compare
|
I think the getter only cps are gonna stay only functions in 2.0 as well, so I don't think there is a need. |
Use new getter/setter for computed if available
This fixes the ~3400 deprecation warnings
Using the same function as getter and setter is deprecated
for beta and canary builds.