Open rnett opened 3 months ago
I have something that looks like
interface LifecycleListener { fun load() {} } interface EntityService { fun getEntities(): List<Entity> } class DefaultEntityService : EntityService, LifecycleListener { private var entities: List<Entity>? = null override fun load() { entities = loadEntities() // not shown } override fun getEntities() { return entities } }
to bind this properly, I need to do
interface EntityComponent { @get:Provides val entityService: EntityService = DefaultEntityService() @get:IntoSet val DefaultEntityService.bind: LifecycleListener = this }
which gets even worse when you add scopes.
I would like to be able to do
interface EntityComponent { @get:Provides @get:IntoSet(LifecycleListener::class) val entityService: EntityService = DefaultEntityService() }
You could support multiple IntoSet annotations on the same binding, too.
IntoSet
I have something that looks like
to bind this properly, I need to do
which gets even worse when you add scopes.
I would like to be able to do