Skip to content

Commit

Permalink
TW-1222 Remove unnecessary memoization
Browse files Browse the repository at this point in the history
  • Loading branch information
keshan3262 committed Dec 26, 2023
1 parent d1ddca7 commit da4106e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/replaceAds.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import memoize from 'p-memoize';
import browser from 'webextension-polyfill';

import { ContentScriptType, WEBSITES_ANALYTICS_ENABLED } from 'lib/constants';
Expand All @@ -17,7 +16,7 @@ let oldHref = '';

let processing = false;

const getSliseAdsData = memoize(async (location: Location) => {
const getSliseAdsData = async (location: Location) => {
const { hostname, href } = location;

const res: TempleResponse | nullish = await getIntercom().request({
Expand All @@ -29,7 +28,7 @@ const getSliseAdsData = memoize(async (location: Location) => {
if (res?.type === TempleMessageType.ExternalAdsDataResponse) return res.data;

throw new Error('Unmatched Intercom response');
});
};

const sizeMatchesConstraints = (width: number, height: number) =>
((width >= 600 && width <= 900) || (width >= 180 && width <= 430)) && height >= 60 && height <= 120;
Expand Down

0 comments on commit da4106e

Please sign in to comment.