Skip to content

Commit 5c2466b

Browse files
committed
multiple-srcs: introduce calculatedProduction getter
1 parent 0f0eae1 commit 5c2466b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/multiple-sources/index.js

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

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

0 commit comments

Comments
 (0)