-
Notifications
You must be signed in to change notification settings - Fork 504
/
selectors.ts
47 lines (45 loc) · 1.32 KB
/
selectors.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { lift } from 'ramda'
import { RootState } from 'data/rootReducer'
import { selectors } from 'data'
export const getData = (state: RootState) => {
const ratesR = selectors.components.interest.getRates(state)
const formErrors = selectors.form.getFormSyncErrors('interestDepositForm')(
state
)
const coin = selectors.components.interest.getCoinType(state)
const interestLimitsR = selectors.components.interest.getInterestLimits(state)
const interestRateR = selectors.components.interest.getInterestRate(state)
const depositLimits = selectors.components.interest.getDepositLimits(state)
const displayCoin = selectors.components.interest.getCoinDisplay(state)
const paymentR = selectors.components.interest.getPayment(state)
const supportedCoinsR = selectors.core.walletOptions.getSupportedCoins(state)
const walletCurrencyR = selectors.core.settings.getCurrency(state)
return lift(
(
rates,
interestLimits,
interestRate,
payment,
supportedCoins,
walletCurrency
) => ({
coin,
formErrors,
depositLimits,
displayCoin,
interestLimits,
interestRate,
payment,
rates,
supportedCoins,
walletCurrency
})
)(
ratesR,
interestLimitsR,
interestRateR,
paymentR,
supportedCoinsR,
walletCurrencyR
)
}