Is it possible to override a declaration, but use ...
# koin
r
Is it possible to override a declaration, but use the original declaration inside the overriding one? I'm trying to achieve a setup similar to this:
Copy code
val coreModule = module { single<Foo> { Foo() } }
val mainModule = module(override = true) { single<Foo> { DecoratedFoo(get<Foo>()) } }
startKoin(listOf(coreModule, mainModule)
[...]
val foo = get<Foo>()
I want
foo
in the last line to resolve to
DecoratedFoo(Foo())
when I call
get<Foo>()
. Is this possible somehow?