MCPcopy Index your code
hub / github.com/MagicMirrorOrg/MagicMirror / loadDependencies

Method loadDependencies

js/module.js:279–294  ·  view source on GitHub ↗

* Helper method to load all dependencies. * @param {string} funcName Function name to call to get scripts or styles. * @returns {Promise }

(funcName)

Source from the content-addressed store, hash-verified

277 * @returns {Promise<void>}
278 */
279 async loadDependencies (funcName) {
280 let dependencies = this[funcName]();
281
282 const loadNextDependency = async () => {
283 if (dependencies.length > 0) {
284 const nextDependency = dependencies[0];
285 await Loader.loadFileForModule(nextDependency, this);
286 dependencies = dependencies.slice(1);
287 await loadNextDependency();
288 } else {
289 return Promise.resolve();
290 }
291 };
292
293 await loadNextDependency();
294 }
295
296 /**
297 * Load all translations.

Callers 2

loadStylesMethod · 0.95
loadScriptsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected