OO.Registry()

Show:

new Registry()

A map interface for associating arbitrary data with a symbolic name.

Children

A map interface for associating arbitrary data with a symbolic name. Used in place of a plain object to provide additional registration or lookup functionality.

See https://www.mediawiki.org/wiki/OOjs/Registries_and_factories.

Mixes In:
Source:

Methods

lookup(name) → {any|undefined}

Get data for a given symbolic name.

Get data for a given symbolic name.

Parameters:
Name Type Description
name string

Symbolic name

Source:
Returns:

Data associated with symbolic name

Type
any | undefined

register(name, data)

Associate one or more symbolic names with some data.

Associate one or more symbolic names with some data.

Any existing entry with the same name will be overridden.

Parameters:
Name Type Description
name string | Array.<string>

Symbolic name or list of symbolic names

data any

Data to associate with symbolic name

Source:
Fires:
Throws:

Name argument must be a string or array

Type
Error

unregister(name)

Remove one or more symbolic names from the registry.

Remove one or more symbolic names from the registry.

Parameters:
Name Type Description
name string | Array.<string>

Symbolic name or list of symbolic names

Source:
Fires:
Throws:

Name argument must be a string or array

Type
Error

Events

register

...
Parameters:
Name Type Description
name string
data any
Source:

unregister

...
Parameters:
Name Type Description
name string
data any

Data removed from registry

Source: