alexlawrence/declarative — pull request #2 by tonydspaniard (2013-06-08 13:42:19+00:00)
Title: allow map concatenation

Allows the addition of mappings, for example:

```javascript
declarative.mappings.add({
id: '2amigos.ui.js',
prefix: 'data-transform-',
types: ['currency'],
callback: function(element, type, options) {
var $el = $(element);
var sign = options.sign || '$';
var p = parseFloat(isNaN($el.text())?0:$el.text()).toFixed(2).split('.');
$el.html(sign + p[0].split("").reverse().reduce(function(acc, num, i) {
return num + (i && !(i % 3) ? "," : "") + acc;
}, "") + "." + p[1]);
}
})
.add({
id: 'widgets',
prefix: 'data-ui-',
types: ['counter'],
callback: function(element, type, options) {
$(options.target).keyup(function() {
$(element).text($(this).val().length);
});
}
});
```