ConfiguredClass

ConfiguredClass

new ConfiguredClass(config)

A prototype of a generic class that accepts a configuration object which can register a various number of external modules that the class may use.

Parameters:
Name Type Description
config object

An object that is expected to contain a modules object property which contains the list of external modules to register within class.

Version:
  • 1.0
Since:
  • 1.0
Author:
License:
Source:

Members

modules :Object

The external modules that this instance may uses as specified by constructor argument

Type:
  • Object
Since:
  • 1.0
Default Value:
  • {}
Source:

(abstract) noop :function

An dummy no-operation callback function

Type:
  • function
Since:
  • 1.0
Source:

(constant) UNDEF :string

The "undefined" constant to be used while checking if the type of an object is undefined.

Type:
  • string
Since:
  • 1.0
Default Value:
  • undefined
Source:
Example
if (myInstance.UNDEF !== typeof myVar) {...}

Methods

execModuleFn(name, fn, argsopt, thisArgopt)

Execute a given function within a helper external module

Parameters:
Name Type Attributes Description
name string

The module name which defines the called function

fn string

The called function name within the module given by name

args string | Array.<string> <optional>

The function argument or an array of arguments that are passed to the called function

thisArg object <optional>

The context in which the function is executed

Since:
  • 1.0
Source:
Example
myInstance.execModuleFn('utils', 'parseError', err)

(abstract) init()

Class initialization prototype. Normally the children classes call the init method as the last statement of the class constructor.

Since:
  • 1.0
Source: