winter / io.jentz.winter / ComponentBuilder / multiton

multiton

inline fun <reified A : Any, reified R : Any> multiton(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, noinline postConstruct: GFactoryCallback2<A, R>? = null, noinline dispose: GFactoryCallback2<A, R>? = null, noinline factory: GFactory1<A, R>): Unit

Register a multiton factory from type (A) -> R.

A multiton factory is only called once per argument and the result is cached like a singleton.

Parameters

qualifier - An optional qualifier.

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

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

postConstruct - A post construct callback.

dispose - A callback that gets called when the dependency graph gets disposed.

factory - The factory factory.