Description
Originally mentioned in #1872, it turns out dagger allows declaring a subcomponent accessor function with parameters and effectively becomes a factory. This is similar to #171 but specific to just extensions.
If we support this for interop, we may not want to support it without interop as I'm not sure this is really preferable to an explicit (and single) factory.
@DependencyGraph
interface ParentGraph : ChildGraphProvider {
fun createChild(@Provides input: String): ChildGraph
}
@GraphExtension
interface ChildGraph {
// No factory defined here
}
Alternatives/workarounds
Use a traditional GraphExtension.Factory
@DependencyGraph
interface ParentGraph : ChildGraph.Factory {
}
@GraphExtension
interface ChildGraph {
// Define a factory
@GraphExtension.Factory
interface Factory {
fun createChild(@Provides input: String): ChildGraph
}
}
Description
Originally mentioned in #1872, it turns out dagger allows declaring a subcomponent accessor function with parameters and effectively becomes a factory. This is similar to #171 but specific to just extensions.
If we support this for interop, we may not want to support it without interop as I'm not sure this is really preferable to an explicit (and single) factory.
Alternatives/workarounds
Use a traditional
GraphExtension.Factory