Answer the question
In order to leave comments, you need to log in
How to pass parameter to Koin dependency graph?
Sometimes at runtime you need to pass your parameters to the dependency graph.
I'm trying to repeat the example on the documentation site.
I create a simple class with one property.
class A (val info:String)
I am making a module that will provide a singletone of this class, but with a parameter that I will pass at runtime.
val dataModule = module {
single { params -> A(info = params.get()) }
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question