Skip to content

Commit

Permalink
fix(theming): improve getColor memoization resolver performance (#1545
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jzempel committed May 4, 2023
1 parent 9afa534 commit 33a7b1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions packages/theming/.size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"index.cjs.js": {
"bundled": 21035,
"minified": 13433,
"gzipped": 5155
"bundled": 20997,
"minified": 13418,
"gzipped": 5145
},
"index.esm.js": {
"bundled": 20042,
"minified": 12530,
"gzipped": 5047,
"bundled": 20004,
"minified": 12515,
"gzipped": 5036,
"treeshaked": {
"rollup": {
"code": 3933,
"code": 3918,
"import_statements": 216
},
"webpack": {
"code": 4201
"code": 4184
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/theming/src/utils/getColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ export const getColor = memoize(

return retVal;
},
(...args) => JSON.stringify(args)
(hue, shade, theme, transparency) =>
JSON.stringify({ hue, shade, palette: theme?.palette, colors: theme?.colors, transparency })
);

0 comments on commit 33a7b1f

Please sign in to comment.