mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 10:30:04 +01:00
12 lines
426 B
JavaScript
12 lines
426 B
JavaScript
import { createSelector } from 'reselect'
|
|
|
|
export const selectedTokenAddressSelector = (state) => state.metamask.selectedTokenAddress
|
|
export const tokenSelector = (state) => state.metamask.tokens
|
|
export const selectedTokenSelector = createSelector(
|
|
tokenSelector,
|
|
selectedTokenAddressSelector,
|
|
(tokens = [], selectedTokenAddress = '') => {
|
|
return tokens.find(({ address }) => address === selectedTokenAddress)
|
|
}
|
|
)
|