Skip to content

Commit fb1df73

Browse files
committed
single-src: introduce calculatedProduction getter
1 parent a1c644c commit fb1df73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/single-source/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export class ProductionPlan {
88
return this._production;
99
}
1010

11+
get calculatedProduction() {
12+
return this._adjustments.reduce((sum, a) => sum + a.amount, 0);
13+
}
14+
1115
applyAdjustment(anAdjustment) {
1216
this._adjustments.push(anAdjustment);
1317
this._production += anAdjustment.amount;

0 commit comments

Comments
 (0)