MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / load

Method load

src/components/fileTree/index.js:44–66  ·  view source on GitHub ↗

* Load and render entries for a directory * @param {string} url - Directory URL

(url)

Source from the content-addressed store, hash-verified

42 * @param {string} url - Directory URL
43 */
44 async load(url) {
45 if (this.isLoading) return;
46 this.isLoading = true;
47 this.currentUrl = url;
48
49 try {
50 this.clear();
51
52 const entries = await this.options.getEntries(url);
53 this.entries = helpers.sortDir(entries, {
54 sortByName: true,
55 showHiddenFiles: true,
56 });
57
58 if (this.entries.length > VIRTUALIZATION_THRESHOLD) {
59 this.renderVirtualized();
60 } else {
61 this.renderWithFragment();
62 }
63 } finally {
64 this.isLoading = false;
65 }
66 }
67
68 /**
69 * Render using DocumentFragment for batch DOM updates (small folders)

Callers 11

refreshMethod · 0.95
expandListFunction · 0.95
index.jsFile · 0.45
toggleMethod · 0.45
showRewardedStepFunction · 0.45
loadAdFunction · 0.45
injectFontFaceFunction · 0.45
loadFontFunction · 0.45
index.jsFile · 0.45

Calls 3

clearMethod · 0.95
renderVirtualizedMethod · 0.95
renderWithFragmentMethod · 0.95

Tested by

no test coverage detected