perf(nextjs): evaluates slide element attributes in parallel
This commit is contained in:
parent
05835cbd48
commit
aaaf16543f
1 changed files with 3 additions and 5 deletions
|
|
@ -159,11 +159,9 @@ async function screenshotElement(element: ElementAttributes, screenshotsDir: str
|
|||
|
||||
|
||||
async function getSlidesAttributes(slides: ElementHandle<Element>[], screenshotsDir: string): Promise<SlideAttributesResult[]> {
|
||||
const slideAttributes = [];
|
||||
for (const slide of slides) {
|
||||
const attributes = await getAllChildElementsAttributes({ element: slide, screenshotsDir });
|
||||
slideAttributes.push(attributes);
|
||||
}
|
||||
const slideAttributes = await Promise.all(
|
||||
slides.map((slide) => getAllChildElementsAttributes({ element: slide, screenshotsDir }))
|
||||
);
|
||||
|
||||
return slideAttributes;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue