Skip to content

Commit 9799bb3

Browse files
committed
update clients of CustomerData to use the encapsulated version of the data
1 parent 1076ffe commit 9799bb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/nested-record/reader/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { getRawDataOfCustomers } from "../customer-data";
1+
import { getCustomerData } from "../customer-data";
22

33
export function compareUsage(customerID, laterYear, month) {
4-
const later = getRawDataOfCustomers()[customerID].usages[laterYear][month];
5-
const earlier = getRawDataOfCustomers()[customerID].usages[[laterYear - 1]][month];
4+
const later = getCustomerData().rawData[customerID].usages[laterYear][month];
5+
const earlier = getCustomerData().rawData[customerID].usages[[laterYear - 1]][month];
66
return { laterAmount: later, change: later - earlier };
77
}

0 commit comments

Comments
 (0)