Ember.computed.max = function (dependentKey) {
return Ember.reduceComputed.call(null, dependentKey, {
initialValue: -Infinity,
addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {
return Math.max(accumulatedValue, item);
},
removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {
if (item < accumulatedValue) {
return accumulatedValue;
}
}
});
};
xxItem: function (accumulatedValue, item, changeMeta, instanceMeta) {
... magic ...
},
changeMeta
index
item
arrayChanged
property
instanceMeta
A scratch pad for storing
reduce computed state