Skip to content

Commit

Permalink
Removed lodash memoize
Browse files Browse the repository at this point in the history
  • Loading branch information
officiallygod committed Feb 6, 2023
1 parent 3607ff7 commit 9ce7a52
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -891,7 +885,7 @@ export function useGlobalStylesOutput(
return;
}

const stylesheets = generateStylesheetsMemo(
const stylesheets = generateStylesheets(
previewSettings,
storedPreviewSettings
);
Expand Down

0 comments on commit 9ce7a52

Please sign in to comment.