From 617306a8a281059086b45beb8414860b1739984d Mon Sep 17 00:00:00 2001 From: Danny McGee Date: Wed, 11 Oct 2023 10:36:10 -0400 Subject: [PATCH] _Actually_ memoize static SVG rendering --- studio-frontend/src/app/icon.element.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/studio-frontend/src/app/icon.element.ts b/studio-frontend/src/app/icon.element.ts index 5099b4c..189ac0a 100644 --- a/studio-frontend/src/app/icon.element.ts +++ b/studio-frontend/src/app/icon.element.ts @@ -53,9 +53,13 @@ function renderSvg(iconId: string) { .map(([, attr, value]) => [attr, value]) ); - return html` + const result = html` ${unsafeSVG(body)} `; + + RENDER_RESULTS.set(iconId, result); + + return result; }