Skip to content

Commit

Permalink
perf: ⚡️ Use forEach instead of for...of for speedier render
Browse files Browse the repository at this point in the history
  • Loading branch information
phun-ky committed Aug 23, 2024
1 parent a7d863d commit 6c3dda3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/features/spacing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const element = async (targetElement: HTMLElement): Promise<void> => {

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);
Expand All @@ -80,5 +80,5 @@ export const element = async (targetElement: HTMLElement): Promise<void> => {

targetElement.classList.add('is-specced');
await position(property, _value, _speccer_el, targetElement);
}
});
};

0 comments on commit 6c3dda3

Please sign in to comment.