Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 170197f

Browse files
committed
Port ComputedPayment to mobx 4
1 parent 3b133ae commit 170197f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/computed/payment.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
* @fileOverview computed values that are used in payment UI components.
33
*/
44

5-
import { computed, extendObservable } from 'mobx';
5+
import { extendObservable } from 'mobx';
66
import { toSatoshis, toAmountLabel, toLabel } from '../helper';
77

88
const ComputedPayment = store => {
99
extendObservable(store, {
10-
paymentAmountLabel: computed(() =>
11-
toLabel(store.payment.amount, store.settings)
12-
),
13-
paymentFeeLabel: computed(() => toLabel(store.payment.fee, store.settings)),
14-
paymentTotalLabel: computed(() => {
10+
get paymentAmountLabel() {
11+
return toLabel(store.payment.amount, store.settings);
12+
},
13+
get paymentFeeLabel() {
14+
return toLabel(store.payment.fee, store.settings);
15+
},
16+
get paymentTotalLabel() {
1517
const { payment, settings } = store;
1618
const satAmount = toSatoshis(payment.amount, settings);
1719
const satFee = toSatoshis(payment.fee, settings);
1820
return toAmountLabel(satAmount + satFee, settings);
19-
}),
21+
},
2022
});
2123
};
2224

0 commit comments

Comments
 (0)