memoizedGenerateTheme()
function memoizedGenerateTheme(options): ColorTheme
Memoized version of generateTheme to improve performance for repeated calls with the same options.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | GenerateThemeOptions<false> | The options for generating the theme. |
Returns
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