This guide will help you to add dependency injection to a data module.
-
Create a new
di
folder in the data module folder, your folder structure should look like this:data ├── model-name │ ├── src │ │ └── commonMain │ │ └── kotlin │ │ └── model-name │ │ └── di │ └── build.gradle.kts
-
Create a new
DataModelModule
class in thedi
folder.package model-name.di import org.koin.core.annotation.ComponentScan import org.koin.core.annotation.Module @Module @ComponentScan("model-name") class DataModelModule
-
Make sure to add the
DataModelModule
to your koin app module.