Skip to main content

memoizedGenerateTheme()

function memoizedGenerateTheme(options): ColorTheme

Memoized version of generateTheme to improve performance for repeated calls with the same options.

Parameters​

ParameterTypeDescription
optionsGenerateThemeOptions<false>The options for generating the theme.

Returns​

ColorTheme

The generated theme.

Example​

const memoizedGenerateTheme = memoizedGenerateTheme();
const theme1 = memoizedGenerateTheme({ baseColor: '#ff0000', expandPalette: true });
const theme2 = memoizedGenerateTheme({ baseColor: '#ff0000', expandPalette: true });
console.log(theme1 === theme2); // true

Defined in​

tailwind/tailwind.ts:110