You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is intended to gather feedback on making computed properties gettable and settable via native properties (in addition to the get/set methods).
No more issues when a native property is swapped out with a computed property, requiring all API consumers to switch to get/set.
Alt: no more defensively coding with get/set all the time "just in case". *
Better autocomplete/discoverability in REPLs and IDEs.
Less typing.
More "natural" JS.
* Even if you do this, it can't be applied across the board since you still have to deal with native/non-Ember objects which don't have get/set.
Drawbacks:
unknownProperty obviously won't work if you don't actually call get/set. unknownProperty is rarely used - classes tend to declare all of their actual properties. However, if your object actually takes arbitrary properties (like an ES Map), get and set will still be there for you.
Again, not proposing the removal/deprecation of get/set. If you like the methods better, or have use of unknownProperty then they will still be there for you. But I think it would be nice to use native accessors for the majority of cases where you don't even want unknownProperty.
The text was updated successfully, but these errors were encountered:
This issue is intended to gather feedback on making computed properties gettable and settable via native properties (in addition to the
get
/set
methods).For example, instead of:
You could do:
Benefits:
get
/set
.get
/set
all the time "just in case". ** Even if you do this, it can't be applied across the board since you still have to deal with native/non-Ember objects which don't have
get
/set
.Drawbacks:
unknownProperty
obviously won't work if you don't actually callget
/set
.unknownProperty
is rarely used - classes tend to declare all of their actual properties. However, if your object actually takes arbitrary properties (like an ES Map),get
andset
will still be there for you.Again, not proposing the removal/deprecation of
get
/set
. If you like the methods better, or have use ofunknownProperty
then they will still be there for you. But I think it would be nice to use native accessors for the majority of cases where you don't even wantunknownProperty
.The text was updated successfully, but these errors were encountered: