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
then peopleNames will not update correctly when people changes. I've traced the issue to computedPropertySet in ember.js, where it performs the set
ret = setter.call(obj, keyName, value, cachedValue);
In ember-model.js, this ends up being
return existingArray.setObjects(newContentArray)
where existingArray is cachedValue and newContentArray is value. That is, it mutates the cached value and returns it, instead of returning a new, independent value. Thus, when computedPropertySet gets to
if (hadCachedValue && cachedValue === ret) {
return;
}
the comparison will be true, and it will return before getting to the logic to check if it is being watched and call propertyDidChange.
The text was updated successfully, but these errors were encountered:
When you have a
hasMany
property, and define another property using as follows:then
peopleNames
will not update correctly whenpeople
changes. I've traced the issue tocomputedPropertySet
inember.js
, where it performs the setIn
ember-model.js
, this ends up beingwhere
existingArray
iscachedValue
andnewContentArray
isvalue
. That is, it mutates the cached value and returns it, instead of returning a new, independent value. Thus, whencomputedPropertySet
gets tothe comparison will be
true
, and it will return before getting to the logic to check if it is being watched and callpropertyDidChange
.The text was updated successfully, but these errors were encountered: