bindMultiton

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

Binds a multiton: will create an instance on first request and will subsequently always return the same instance.

T generics will be erased!

Parameters

T

The created type.

creator

The function that will be called the first time an instance is requested. Guaranteed to be called only once. Should create a new instance.