DependencyLoader

core. DependencyLoader

Handles the loading of Adapt authoring tool module dependencies.

Constructor

new DependencyLoader(app)

Source:
Parameters:
Name Type Description
app Object The main app instance

Members

app :App

Source:
Reference to the main app
Type:
  • App

configs :Object

Source:
Key/value store of all the Adapt dependencies' configs. Note this includes dependencies which are not loaded as Adapt modules (i.e. `module: false`).
Type:
  • Object

configsLoadedHook :Hook

Source:
Hook called once all module configs are loaded
Type:
  • Hook

failedModules :Array

Source:
List of modules which have failed to load
Type:
  • Array

instances :object

Source:
List of dependency instances
Type:
  • object

moduleLoadedHook :Hook

Source:
Hook for individual module load
Type:
  • Hook

name :String

Source:
Name of the class (onvenience function to stay consistent with other classes)
Type:
  • String

peerDependencies :object

Source:
Peer dependencies listed for each dependency
Type:
  • object

Methods

(async) load() → {Promise}

Source:
Loads all Adapt module dependencies
Returns:
Type
Promise

(async) loadConfigs() → {Promise}

Source:
Loads configs for all dependencies
Returns:
Type
Promise

(async) loadModule(modName) → {Promise}

Source:
Loads a single Adapt module. Should not need to be called directly.
Parameters:
Name Type Description
modName String Name of the module to load
Returns:
Resolves with module instance on module.onReady
Type
Promise

(async) loadModuleConfig(modDir) → {Promise}

Source:
Loads the relevant configuration files for an Adapt module
Parameters:
Name Type Description
modDir String Module directory
Returns:
Type
Promise

(async) loadModules(modules) → {Promise}

Source:
Loads a list of Adapt modules. Should not need to be called directly.
Parameters:
Name Type Description
modules Array Module names
Returns:
Resolves When all modules have loaded (or failed to load)
Type
Promise

logError(…args)

Source:
Logs an error message
Parameters:
Name Type Attributes Description
args * <repeatable>
Arguments to be printed

(async) waitForModule(modName) → {Promise}

Source:
Waits for a single module to load
Parameters:
Name Type Description
modName String Name of module to wait for
Returns:
Resolves with module instance on module.onReady
Type
Promise