Skip to content

Commit

Permalink
chore: cache fee asset selector
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdef1cafe committed May 24, 2022
1 parent 8e0b91d commit dfcd3d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/state/slices/assetsSlice/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const chainIdFeeAssetReferenceMap = (chain: ChainTypes, network: NetworkTypes):
throw new Error(`Chain ${chain} not supported.`)
}

export const selectFeeAssetByChainId = createSelector(
export const selectFeeAssetByChainId = createCachedSelector(
selectAssets,
(_state: ReduxState, chainId: ChainId) => chainId,
(assetsById, chainId): Asset => {
Expand All @@ -79,7 +79,7 @@ export const selectFeeAssetByChainId = createSelector(
})
return assetsById[feeAssetId]
},
)
)((_state: ReduxState, chainId: ChainId | undefined): ChainId => chainId ?? 'undefined')

export const selectFeeAssetById = createSelector(
selectAssets,
Expand Down

0 comments on commit dfcd3d0

Please sign in to comment.