From cfbd23893d79095b0ae281aa1641c2bdb3f96eb3 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Sat, 15 Jul 2023 21:04:18 +0200 Subject: [PATCH] fix: Do not destroy SVG --- src/components/Svg.ts | 6 ------ src/index.ts | 1 - 2 files changed, 7 deletions(-) diff --git a/src/components/Svg.ts b/src/components/Svg.ts index 755b999..c3963a0 100644 --- a/src/components/Svg.ts +++ b/src/components/Svg.ts @@ -15,7 +15,6 @@ export type Svg = { textType: TextType, options?: MeasureTextOptions ) => DOMRect; - destroy: () => void; }; export type SVGSelection = Selection< @@ -81,14 +80,9 @@ export const createSvg = (div: HTMLDivElement, options: StoryOptions): Svg => { }; }; - const destroy = (): void => { - selection.remove(); - }; - return { selection, measure, measureText, - destroy, }; }; diff --git a/src/index.ts b/src/index.ts index 9575eae..8b9971b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -179,7 +179,6 @@ const makeStory = ( const destroy = (): void => { resizeObserver.destroy(); fontLoadObserver.destroy(); - svg.destroy(); }; return {