Methods
(p_id) → {Constructor}
GetClassRetrieves a class constructor associated with a given ID.
In order for a constructor to be retrievable using GetClass
, it needs to have been
manually registered using Register
before; or registered automatically
through Rent
before.
GetClass
, make sure to Register
that class before.Parameters:
Name | Type | Description |
---|---|---|
p_id |
string | String ID of the |
(p_class)
RegisterRegisters a class to the pool.
Note that there is only very rare use cases where you may need to manually Register
a class;
as soon as you attempt to Rent
an object instance, it will be automatically registered
if it wasn't already.
The main use case for manual Register
is to make sure a class instance is accessible
through its string identifier, making it available in contexts that purposefully do no import @nkmjs modules.
Parameters:
Name | Type | Description |
---|---|---|
p_class |
class |
Methods
(p_class)
RentParameters:
Name | Type | Description |
---|---|---|
p_class |
constructor | String | Either a class constructor, or its associated string ID. |
Methods
_Register(p_class)
Parameters:
Name | Type | Description |
---|---|---|
p_class |
DisposableObject |
_Return(p_obj)
Parameters:
Name | Type | Description |
---|---|---|
p_obj |
DisposableObject |