From 6c3dda3f72abdcb1a7b2955b5e79a45584dbbea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Vassbotn=20R=C3=B8yne-Helgesen?= Date: Fri, 23 Aug 2024 13:57:18 +0200 Subject: [PATCH] =?UTF-8?q?perf:=20=E2=9A=A1=EF=B8=8F=20Use=20`forEach`=20?= =?UTF-8?q?instead=20of=20`for...of`=20for=20speedier=20render?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/spacing/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/spacing/index.ts b/src/features/spacing/index.ts index 04ea4b5..caedc1d 100644 --- a/src/features/spacing/index.ts +++ b/src/features/spacing/index.ts @@ -70,7 +70,7 @@ export const element = async (targetElement: HTMLElement): Promise => { if (!_target_pruned_spacing_styles.length) return; - for (const property of _target_pruned_spacing_styles) { + _target_pruned_spacing_styles.forEach(async (property) =>{ const _value = getNumberValue(_target_spacing_styles[property]); const _speccer_el = create(_value); const _class_name = getClassNameFromCSSProperty(property); @@ -80,5 +80,5 @@ export const element = async (targetElement: HTMLElement): Promise => { targetElement.classList.add('is-specced'); await position(property, _value, _speccer_el, targetElement); - } + }); };