Constructor
new OO.Registry()
#
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:
A map interface for associating arbitrary data with a symbolic name.
Methods
lookup(name) → {any|undefined
}
#
undefined
}
#
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
Get data for a given symbolic name.
register(name, 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
Associate one or more symbolic names with some data.
unregister(name)
#
Remove one or more symbolic names from the registry.
Events
register(name, data)
#
unregister(name, data)
#
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
data |
any | Data removed from registry |
- Source: