Expand all

ModuleLoader

Constructor

new ModuleLoader() #

Class for managing modules

A module in this context is essentially a Javascript class (not to be confused with ResourceLoader modules).

Source:

Class for managing modules

A module in this context is essentially a Javascript class (not to be confused with ResourceLoader modules).

Methods

define(id, obj) → {Object} #

Define a module which can be later required (imported) using require().

Parameters:

Name Type Description
id string

Defined module id.

obj Object

Defined module body, can be any JavaScript object.

Source:

Returns:

Type
Object
Define a module which can be later required (imported) using require().

deprecate(id, obj, [replacement]) #

Deprecate a module and give an replacement (if there is any).

Parameters:

Name Type Attributes Description
id string

Defined module id, which is deprecated.

obj Object

Defined module body, can be any JavaScript object.

replacement string optional

Give an optional replacement for this module (which needs to be already defined!)

Source:
Deprecate a module and give an replacement (if there is any).

require(id) → {Object} #

Require (import) a module previously defined using define(). Searches core module registry using ResourceLoader require before consulting its own local registry. This method is deprecated, please do not use.

Parameters:

Name Type Description
id string

Required module id.

Source:

Returns:

Required module, can be any JavaScript object.

Type
Object
Require (import) a module previously defined using define().