I have a definition which I add at runtime via `ge...
# koin
l
I have a definition which I add at runtime via
getKoin().declare(MyObject())
.
Copy code
class MyObject(val source: Map<String, Any> = emptyMap())
Later I redeclare it, but with data:
getKoin().declare(MyObject(mapOf("key" to value), allowOverride = true))
My API exposes this object like:
Copy code
class Api : KoinComponent {
  val myObject: MyObject by inject()
}
but when I access it, I get the old version of the object with empty map. Any ideas? EDIT: When I call
getKoin().get<DeviceContext>()
at the position where I want to access the map, I get the correct object, while
api.myObject
is another object. I'm wondering how this can be since by inject is lazy, so actually it should grab the recent one