epitome-mvc/Epitome — pull request #14 by megawac (2013-12-18 07:27:55+00:00)
Title: Property setters can now return value

Allow model property setters to return a value after processing so custom handling is not necessary.

Taking an example from the docs we can change this property change handler:

```
properties: {
price: {
set: function(value) {
// get current value and prep new value.
var currentValue = this.get('price'),
newValue = '$' + value;
// store it in the attributes object
this._attributes['price'] = newValue;
// see if we need to raise change events
if (!Epitome.isEqual(currentValue, newValue)) {
// individual event
this.trigger('change:price', newValue);
// if a part of a set({obj}), general change as well.
this.propertiesChanged.push('price');
}
}
}
}
```

to simply this equivalent code:

```
properties: {
price: {
set: function(value) {
return '$' + value;
}
}
}
```