From 9ce7a52096235082a5502b0e000ca7b4ac512243 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Mon, 6 Feb 2023 20:58:57 +0530 Subject: [PATCH] Removed lodash memoize --- .../utils/global-styles/use-global-styles-output.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/OnboardingSPA/utils/global-styles/use-global-styles-output.js b/src/OnboardingSPA/utils/global-styles/use-global-styles-output.js index 4cc4b029d..79d570b82 100644 --- a/src/OnboardingSPA/utils/global-styles/use-global-styles-output.js +++ b/src/OnboardingSPA/utils/global-styles/use-global-styles-output.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { get, isEmpty, kebabCase, pickBy, reduce, set, memoize } from 'lodash'; +import { get, isEmpty, kebabCase, pickBy, reduce, set } from 'lodash'; /** * WordPress dependencies @@ -872,12 +872,6 @@ const generateStylesheets = ( previewSettings, storedPreviewSettings ) => { return stylesheets; }; -// This function serializes those objects into JSON strings to determine the cache key. -const resolver = ( arg1, arg2 ) => JSON.stringify( [ arg1, arg2 ] ); - -// Make a Memoized function that runs when the input changes -const generateStylesheetsMemo = memoize( generateStylesheets, resolver ); - export function useGlobalStylesOutput( previewSettings, storedPreviewSettings @@ -891,7 +885,7 @@ export function useGlobalStylesOutput( return; } - const stylesheets = generateStylesheetsMemo( + const stylesheets = generateStylesheets( previewSettings, storedPreviewSettings );