Add debounced multiple computed property support.

This commit is contained in:
Kevin Schaaf
2015-02-23 20:04:16 -08:00
parent d61f407205
commit 9d5ee38f02
5 changed files with 109 additions and 81 deletions

View File

@@ -13,6 +13,10 @@
type: Number,
notify: true
},
computedFromMultipleValues: {
type: Number,
notify: true
},
camelNotifyingValue: {
type: Number,
notify: true
@@ -25,13 +29,15 @@
},
computed: {
computedvalue: 'computeValue(value)',
computednotifyingvalue: 'computeNotifyingValue(notifyingvalue)'
computednotifyingvalue: 'computeNotifyingValue(notifyingvalue)',
computedFromMultipleValues: 'computeFromMultipleValues(sum1, sum2, divide)'
},
bind: {
value: 'valueChanged',
computedvalue: 'computedvalueChanged',
notifyingvalue: 'notifyingvalueChanged',
readonlyvalue: 'readonlyvalueChanged'
readonlyvalue: 'readonlyvalueChanged',
computedFromMultipleValues: 'computedFromMultipleValuesChanged'
},
valueChanged: function() {},
computeValue: function(val) {
@@ -42,7 +48,11 @@
readonlyvalueChanged: function() {},
computeNotifyingValue: function(val) {
return val + 2;
}
},
computeFromMultipleValues: function(sum1, sum2, divide) {
return (sum1 + sum2) / divide;
},
computedFromMultipleValuesChanged: function() {}
});
</script>