It's using a map to cache the object in the compon...
# kotlin-inject
e
It's using a map to cache the object in the component when you scope it.
d
I see the declaration:
public override val _scoped: LazyMap = LazyMap()
and the usage
_scoped.get(...)
, but I don't see it being initialized anywhere...?
e
The get caches it, similar to using
by lazy {}
👍🏼 1
d
Oh... now I see the lambda after it... I was worried that I was doing something wrong! It's all in one humongous line, so it's a bit hard to read. And the
@AppScope
needs to be on both the component, and each dependency that needs to be saved in the scope I suppose? So I can't really make the
@AppScope
include the
@Provides
to avoid writing both for each dependency...
In Micronaut, there's a
@Singleton
annotation that does both at once...