newInstance

fun <T> DIAware.newInstance(creator: DirectDI.() -> T): LazyDelegate<T>

Allows to create a new instance of an unbound object with the same API as when bounding one.

Parameters

T

The type of object to create.

creator

A function that do create the object.


inline fun <T> DirectDIAware.newInstance(creator: DirectDI.() -> T): T

Allows the creation of a new instance with DI injection.