Skip to content

Commit

Permalink
feat: removed lodash memoize in favour of micro-memoize
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinBattilana committed Nov 29, 2023
1 parent ecc9228 commit 4919627
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
"fuse.js": "^6.6.2",
"gray-matter": "^4.0.3",
"immer": "^9.0.15",
"lodash.memoize": "^4.1.2",
"lowdb": "^3.0.0",
"micro-memoize": "^4.1.2",
"mixpanel-browser": "^2.45.0",
"next": "12.1.1",
"react": "latest",
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/pool/useGhoPoolFormattedReserve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReservesDataHumanized } from '@aave/contract-helpers';
import { formatGhoReserveData, GhoReserveData } from '@aave/math-utils';
import { memoize } from 'lodash';
import memoize from 'micro-memoize';
import { MarketDataType } from 'src/ui-config/marketsConfig';
import { GHO_SYMBOL } from 'src/utils/ghoUtilities';

Expand Down Expand Up @@ -29,6 +29,7 @@ const selector = memoize((ghoReserveData: GhoReserveData, reservesData: Reserves
export const useGhoPoolsFormattedReserve = (marketsData: MarketDataType[]) => {
const ghoReservesQueries = useGhoPoolsReserve(marketsData);
const reservesQueries = usePoolsReservesHumanized(marketsData);

return ghoReservesQueries.map((elem, index) => {
return combineQueries([elem, reservesQueries[index]] as const, selector);
});
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/pool/useUserGhoPoolFormattedReserve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { formatGhoUserData, GhoReserveData, GhoUserData } from '@aave/math-utils';
import dayjs from 'dayjs';
import { memoize } from 'lodash';
import memoize from 'micro-memoize';
import { MarketDataType } from 'src/ui-config/marketsConfig';

import { useGhoPoolsReserve } from './useGhoPoolReserve';
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9032,11 +9032,6 @@ lodash.kebabcase@^4.1.1:
resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36"
integrity sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==

lodash.memoize@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==

lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz"
Expand Down Expand Up @@ -9378,6 +9373,11 @@ messageformat-parser@^4.1.3:
resolved "https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.1.3.tgz"
integrity sha512-2fU3XDCanRqeOCkn7R5zW5VQHWf+T3hH65SzuqRvjatBK7r4uyFa5mEX+k6F9Bd04LVM5G4/BHBTUJsOdW7uyg==

micro-memoize@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/micro-memoize/-/micro-memoize-4.1.2.tgz#ce719c1ba1e41592f1cd91c64c5f41dcbf135f36"
integrity sha512-+HzcV2H+rbSJzApgkj0NdTakkC+bnyeiUxgT6/m7mjcz1CmM22KYFKp+EVj1sWe4UYcnriJr5uqHQD/gMHLD+g==

micromark-core-commonmark@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz#1386628df59946b2d39fb2edfd10f3e8e0a75bb8"
Expand Down

0 comments on commit 4919627

Please sign in to comment.