Class: Registry

Registry

new Registry()

Methods

add(nameopt, itemopt)

Register an item and return it.

Adds an item to the registry using the provided name (or the class name), converted to all lower case.

Parameters:
Name Type Attributes Description
name string <optional>

Case-insensitive item key. If not given, fallsback to item.prototype.$$CLASS_NAME or item.prototype.name or item.name.

item <optional>

If unregistered or omitted, nothing is added and method returns undefined.

Note: $$CLASS_NAME is normally set by providing a string as the (optional) first parameter (alias) in your extend call.

Returns:

Newly registered item or undefined if unregistered.

addSynonym(synonymName, existingName) → {function|Constructor}

Register a synonym for an existing item.

Parameters:
Name Type Description
synonymName string
existingName string
Returns:

The previously registered item this new synonym points to.

Type
function | Constructor

get(nameopt) → {*|undefined}

Fetch a registered item.

Parameters:
Name Type Attributes Description
name string <optional>
Returns:

A registered item or undefined if unregistered.

Type
* | undefined