how do I best configure my koin dependencies based...
# koin
r
how do I best configure my koin dependencies based on a setting? E.g. I might want to have a development setting using a memory database and a production setting using the actual database. In Spring I'd usually solve this using profiles
a
we don't have profile in Koin, which could be intersting. You can manually use Kotlin expressions to load definitions depending on a boolean expression in a module:
Copy code
val myModule = module {
    if (isDev) {
    
      // definitions
    } else {
     // other definitions
    }
}
r
@arnaud.giuliani I'd avoid boolean flag at almost any cost 😛 that said, it's trivial to do as proper enums (which is the correct and natural choice anyway)
and I guess having that would do the trick in a decent way, although I think a profile-ish structure would be nice, since having conditional logic like that will become messy quite fast