winter / io.jentz.winter / Component / Builder / weakSingleton

weakSingleton

inline fun <reified R : Any> weakSingleton(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, noinline onPostConstruct: GFactoryCallback<R>? = null, noinline factory: GFactory<R>): TypeKey<R>

Register a weak singleton scoped factory for an instance of type R.

Parameters

qualifier - An optional qualifier.

generics - If true this will preserve generic information of R.

override - If true this will override a existing provider of this type.

onPostConstruct - A post construct callback.

factory - The factory for type R.