mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
Use reduce to handle doc items sequentially
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
parent
1e8b06d0a4
commit
c7525d463b
1 changed files with 4 additions and 4 deletions
|
@ -268,10 +268,10 @@ export const DefaultSidebarItemsGenerator: SidebarItemsGenerator = async functio
|
|||
}
|
||||
|
||||
// async process made sequential on purpose! order matters
|
||||
for (const doc of docs) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await handleDocItem(doc);
|
||||
}
|
||||
await docs.reduce(
|
||||
(p, doc) => p.then(() => handleDocItem(doc)),
|
||||
Promise.resolve(),
|
||||
);
|
||||
|
||||
return sidebarItems;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue