enh(utils) add decrement mechanism
This commit is contained in:
@@ -15,7 +15,6 @@ export default class Utils extends CetraPlugin {
|
|||||||
initComponent(component) {}
|
initComponent(component) {}
|
||||||
|
|
||||||
increment(val, options = { amount: 1 }) {
|
increment(val, options = { amount: 1 }) {
|
||||||
console.log('increment', val, options);
|
|
||||||
const { amount } = options;
|
const { amount } = options;
|
||||||
return val + amount;
|
return val + amount;
|
||||||
}
|
}
|
||||||
@@ -23,4 +22,13 @@ export default class Utils extends CetraPlugin {
|
|||||||
increase(val, options = { amount: 1 }) {
|
increase(val, options = { amount: 1 }) {
|
||||||
return this.increment(val, options);
|
return this.increment(val, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
decrement(val, options = { amount: 1 }) {
|
||||||
|
const { amount } = options;
|
||||||
|
return val - amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
decrease(val, options = { amount: 1 }) {
|
||||||
|
return this.decrement(val, options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user