Hey guys maybe a silly question: Is there some way...
# koin
m
Hey guys maybe a silly question: Is there some way to intercept the Koin plugin so we can add modules ad hoc? let me explain: on a Ktor project I’m trying to set up I would like to modularize the features so each feature provides their own DI modules (that latter on they will be provided on the koin plugin. What I’m trying to do? instead of defining the di module in the feature and then provide i in the main application plugin, something like this:
Copy code
// In my feature module
val featureModule = module {
    singleOf(::WhateverImplementation){ binds<WateverInterface>() }

// Main app module
...
install(Koin) {
   modules(featureModule)
}
I’d like something like (pseudocode)
Copy code
//feature module
fun Application.featurePlugin() {
-> inject here the featureModule to Koin

rest of the feature configuration
}

// main app module
fun Application.main() {
    featurePlugin() <- this way I can keep all configs isolated into feature module and i just need to add it into a single entry point
}
Does it make sense? is there any solution/idea already implemented or that would make more sense than this? ty!