Class: RegistryBase

RegistryBase()

Base class for all registries.

LocusZoom is plugin-extensible, and layouts are JSON-serializable objects that refer to desired features by name (not by class). This is achieved through the use of a central registry that holds a reference to each possible feature.

Each registry has some syntactical sugar to make it easier to, eg, modify layouts or create classes. This class is documented solely so that those helper methods can be referenced.

Constructor

new RegistryBase()

Source:

Methods

add(name, item, overrideopt) → {*}

Add a new item to the registry

Parameters:
Name Type Attributes Default Description
name String

The name of the item to add to the registry

item *

The item to be added (constructor, value, etc)

override boolean <optional>
false

Allow redefining an existing item?

Source:
Returns:

The actual object as added to the registry

Type
*

get(name) → {function}

Return the registry member. If the registry stores classes, this returns the class, not the instance.

Parameters:
Name Type Description
name String
Source:
Returns:
Type
function

has(name) → {boolean}

Check whether the specified item is registered

Parameters:
Name Type Description
name String
Source:
Returns:
Type
boolean

list() → {Array.<String>}

Names of each allowed

Source:
Returns:
Type
Array.<String>

remove(name) → {boolean}

Remove a datasource from the registry (if present)

Parameters:
Name Type Description
name String
Source:
Returns:

True if item removed, false if item was never present

Type
boolean