Browse Source

Parallelize ToC initialization step

master
buttercat1791 8 months ago
parent
commit
70e7674a77
  1. 11
      src/lib/components/publications/table_of_contents.svelte.ts

11
src/lib/components/publications/table_of_contents.svelte.ts

@ -155,11 +155,12 @@ export class TableOfContents {
this.addressMap.set(rootAddress, this.#root); this.addressMap.set(rootAddress, this.#root);
// TODO: Parallelize this. // Handle any other nodes that have already been resolved in parallel.
// Handle any other nodes that have already been resolved. await Promise.all(
this.#publicationTree.resolvedAddresses.forEach((address) => { Array.from(this.#publicationTree.resolvedAddresses).map((address) =>
this.#buildTocEntryFromResolvedNode(address); this.#buildTocEntryFromResolvedNode(address)
}); )
);
// Set up an observer to handle progressive resolution of the publication tree. // Set up an observer to handle progressive resolution of the publication tree.
this.#publicationTree.onNodeResolved((address: string) => { this.#publicationTree.onNodeResolved((address: string) => {

Loading…
Cancel
Save