PrototypeRegistry

PrototypeRegistry

Class for keeping prototypes - skeletons of elements to be cloned instead of creating a new one from scratch (which is often expensive).

Constructor

new PrototypeRegistry()

Source:

Methods

add(id, prototype)

Source:

Register a prototype.

Parameters:
Name Type Description
id string
prototype *

addWidget(id, widget)

Source:

Add a widget intended for creation of an object with certain characteristics (e.g. OOUI).

Parameters:
Name Type Description
id string
widget function

get(id) → (nullable) {*}

Source:

Get a prototype or an instance of a widget.

Parameters:
Name Type Description
id string
Returns:
Type
*

getWidget(id) → (nullable) {function}

Source:
Parameters:
Name Type Description
id string
Returns:
Type
function