FactoryExtends
Description
Interface that describes the factory functions. A specific type of function that are used to create the instances of the objects related to external data stored in a Container
.
Methods
<OBJECT extends object>( container: CONTAINER, object: OBJECT ): OBJECT & TARGET
The function signature of the factory.
Parameters
Name | Type | Description |
---|---|---|
CONTAINER | The related container with the stored data for the factory. | |
OBJECT | The base object from where to create the target object. |
Returns
The provided object with the elements of the target object to be created.
Factory
Description
Constant with the utils functions for Factory
objects.
Methods
createFrom<CONTAINER extends Container<any>, TARGET extends object>( factory: any ): Factory<CONTAINER, TARGET>
Creates a new factory function that applies the factory function provided.
Parameters
Name | Type | Description |
---|---|---|
any | The factory function to be applied. |
createFrom<CONTAINER extends Container<any>, TARGET1 extends object, TARGET2 extends object>( factory1: any, factory2: any ): Factory<CONTAINER, TARGET1 & TARGET2>
Creates a new factory function that applies the two factory functions provided.
Parameters
Name | Type | Description |
---|---|---|
any | The fist factory function to be applied. | |
any | The second factory function to be applied. |
createFrom<CONTAINER extends Container<any>, TARGET1 extends object, TARGET2 extends object, TARGET3 extends object>( factory1: any, factory2: any, factory3: any ): Factory<CONTAINER, TARGET1 & TARGET2 & TARGET3>
Creates a new factory function that applies the three factory functions provided.
Parameters
Name | Type | Description |
---|---|---|
any | The first factory function to be applied. | |
any | The second factory function to be applied. | |
any | The third factory function to be applied. |
createFrom<CONTAINER extends Container<any>, TARGET1 extends object, TARGET2 extends object, TARGET3 extends object, TARGET4 extends object>( factory1: any, factory2: any, factory3: any, factory4: any ): Factory<CONTAINER, TARGET1 & TARGET2 & TARGET3 & TARGET4>
Creates a new factory function that applies the four factory functions provided.
Parameters
Name | Type | Description |
---|---|---|
any | The first factory function to be applied. | |
any | The second factory function to be applied. | |
any | The third factory function to be applied. | |
any | The fourth factory function to be applied. |
createFrom<CONTAINER extends Container<any>, TARGET1 extends object, TARGET2 extends object, TARGET3 extends object, TARGET4 extends object, TARGET5 extends object>( factory1: any, factory2: any, factory3: any, factory4: any, factory5: any ): Factory<CONTAINER, TARGET1 & TARGET2 & TARGET3 & TARGET4 & TARGET5>
Created a new factory function that applies the five factory functions provided.
Parameters
Name | Type | Description |
---|---|---|
any | The first factory function to be applied. | |
any | The second factory function to be applied. | |
any | The third factory function to be applied. | |
any | The fourth factory function to be applied. | |
any | The fifth factory function to be applied. |
createFrom<CONTAINER extends Container<any>, TARGET1 extends object, TARGET2 extends object, TARGET3 extends object, TARGET4 extends object, TARGET5 extends object, TARGET6 extends object>( factory1: any, factory2: any, factory3: any, factory4: any, factory5: any, factory6: any ): Factory<CONTAINER, TARGET1 & TARGET2 & TARGET3 & TARGET4 & TARGET5 & TARGET6>
Created a new factory function that applies the six factory functions provided.
Parameters
Name | Type | Description |
---|---|---|
any | The first factory function to be applied. | |
any | The second factory function to be applied. | |
any | The third factory function to be applied. | |
any | The fourth factory function to be applied. | |
any | The fifth factory function to be applied. | |
any | The sixth factory function to be applied. |