bindSingleton

abstract fun bindSingleton(tag: Any? = null, overrides: Boolean? = null, ref: RefMaker? = null, sync: Boolean = true, creator: NoArgBindingDI<Any>.() -> T)

Binds a singleton to both the set and the DI container.

Parameters

tag

The tag to bind in the DI container.

overrides

Whether this bind must or must not override an existing binding.

ref

The reference maker to use (null for eager singleton).

sync

Whether the singleton should be thread-safe.

creator

The function that creates the singleton instance.