-
Notifications
You must be signed in to change notification settings - Fork 504
/
selectors.ts
31 lines (20 loc) · 1.05 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
import { RatesType, RemoteDataType } from 'core/types'
import { RootState } from '../../rootReducer'
import { selectors } from 'data'
export const getCoinType = (state: RootState) => state.components.borrow.coin
export const getPayment = (state: RootState) => state.components.borrow.payment
export const getLimits = (state: RootState) => state.components.borrow.limits
export const getLoan = (state: RootState) => state.components.borrow.loan
export const getLoanTransactions = (state: RootState) =>
state.components.borrow.loanTransactions
export const getOffers = (state: RootState) => state.components.borrow.offers
export const getOffer = (state: RootState) => state.components.borrow.offer
export const getBorrowHistory = (state: RootState) =>
state.components.borrow.borrowHistory
export const getRates = (
state: RootState
): RemoteDataType<string, RatesType> => {
const coinType = getCoinType(state)
return selectors.core.data.misc.getRatesSelector(coinType, state)
}
export const getStep = (state: RootState) => state.components.borrow.step