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

Description:
  • Reference to the main app
Source:
Reference to the main app
Type:
  • App

configs :Object

Description:
  • Key/value store of all the Adapt dependencies' configs. Note this includes dependencies which are not loaded as Adapt modules (i.e. `module: false`).
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

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

failedModules :Array

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

instances :object

Description:
  • List of dependency instances
Source:
List of dependency instances
Type:
  • object

moduleLoadedHook :Hook

Description:
  • Hook for individual module load
Source:
Hook for individual module load
Type:
  • Hook

name :String

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

peerDependencies :object

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

Methods

(async) load() → {Promise}

Description:
  • Loads all Adapt module dependencies
Source:
Returns:
Type
Promise

(async) loadConfigs() → {Promise}

Description:
  • Loads configs for all dependencies
Source:
Returns:
Type
Promise

(async) loadModule(modName) → {Promise}

Description:
  • Loads a single Adapt module. Should not need to be called directly.
Source:
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}

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

(async) loadModules(modules) → {Promise}

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

logError(…args)

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

(async) waitForModule(modName) → {Promise}

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