Namespace: module

BX. module

Module system.

Source:

Classes

Module

Methods

(static) define (name, factory, rewriteModeopt)

Adds new module.

Parameters:
Name Type Attributes Default Description
name string

Name of the module.

factory *

Module object or factory function.

rewriteMode string <optional>
'error'

How to redefine module if it already exists: 'error' = throw an exception (default), 'skip' = keep the old definition, 'rewrite' = rewrite the old definition.

Source:

(static) exists (name) → {boolean}

Checks if the module exists.

Parameters:
Name Type Description
name string

Name of the module.

Returns:
  • boolean
Source:

(static) list () → {Array}

Returns the list of the module names.

Returns:
  • Array
Source:

(static) Me (name) → {function}

Returns the property Me of the module. Property Me should hold the constructor of the object wrapped by this module.

Parameters:
Name Type Description
name string

Module name.

Throws:
  • Exception if module.Me is missing or is not a Function.

Returns:
  • function
Source:

(static) module (name) → {*}

Returns instance of the module. If instance is defined as a creation function, it is invoked only on the first call of the get() method. There is available method BX.module() as a shortcut to BX.module.module().

Parameters:
Name Type Description
name string

Name of the module.

Returns:
  • *
Source: