bindEagerSingleton

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

Binds an eager singleton: will create an instance as soon as kodein is ready (all bindings are set) and will always return this instance.

T generics will be erased!

Parameters

T

The created type.

creator

The function that will be called as soon as DI is ready. Guaranteed to be called only once. Should create a new instance.