Skip to content

2025

Extending Kotlin Inject Anvil for Assisted Factories

Image title

I recently started using Kotlin inject anvil in my kotlin multiplatform (KMP) projects for dependency injection. However when using assisted injection I noticed myself writing boilerplate code to bind assisted factory method interfaces. In the process of trying to not write all this boiler plate code, I ended up writing a library that extends kotlin inject anvil to generate the code necessary to bind the assisted factory interface. Learn how to use this extension to bind assisted factory method interfaces.