bindFactory

inline fun <A : Any, T : Any> DI.Builder.bindFactory(tag: Any? = null, overrides: Boolean? = null, noinline creator: DirectDI.(A) -> T)

Binds a factory: each time an instance is needed, the function creator function will be called.

A & T generics will be erased!

Parameters

A

The argument type.

T

The created type.

creator

The function that will be called each time an instance is requested. Should create a new instance.