izumi.distage.constructors.ClassConstructor
See theClassConstructor companion object
final class ClassConstructor[T](val provider: Functoid[T]) extends AnyVal, AnyConstructorBase[T]
An implicitly summonable constructor for a concrete class T
Attributes
- Returns
- Example
-
import distage.{ClassConstructor, Functoid, Injector, ModuleDef} class A(val i: Int) val constructor: Functoid[A] = ClassConstructor[A] val lifecycle = Injector().produceGet[A](new ModuleDef { make[A].from(constructor) make[Int].fromValue(5) }) lifecycle.use { (a: A) => println(a.i) }
- Companion
- object
- Graph
-
- Supertypes
Members list
In this article