Hi all, How do you pass parameters to a scope? I c...
# koin
s
Hi all, How do you pass parameters to a scope? I can define like this:
Copy code
scope(named<Example>()) {
    scoped { params -> Example(name = params.get()) }
}
but how do I resolve the instance in the scope afterwards? Thanks!
1
Found it! It is not documented (or I didn’t find it), but if anyone needs it:
Copy code
val example = scope
    .inject<Example> { parametersOf("first") }
    .value
a
oo I was looking for exactly that!
a
if you use ìnject().value, replace it directly with get() then