From dfcd3d0fe50600181d3ef3912ac99bb8f5c59d8e Mon Sep 17 00:00:00 2001 From: 0xdef1cafe <88504456+0xdef1cafe@users.noreply.github.com> Date: Tue, 24 May 2022 14:29:30 -0600 Subject: [PATCH] chore: cache fee asset selector --- src/state/slices/assetsSlice/selectors.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state/slices/assetsSlice/selectors.ts b/src/state/slices/assetsSlice/selectors.ts index 4815b6481f6..90acc84df0d 100644 --- a/src/state/slices/assetsSlice/selectors.ts +++ b/src/state/slices/assetsSlice/selectors.ts @@ -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 => { @@ -79,7 +79,7 @@ export const selectFeeAssetByChainId = createSelector( }) return assetsById[feeAssetId] }, -) +)((_state: ReduxState, chainId: ChainId | undefined): ChainId => chainId ?? 'undefined') export const selectFeeAssetById = createSelector( selectAssets,