Can someone explain the rationale behind injection...
# koin
m
Can someone explain the rationale behind injection parameters for
single
components? Does it mean the parametersOf() is only used the first time the component is fetched/injected? https://doc.insert-koin.io/#/koin-core/injection-parameters
a
Does it mean the parametersOf() is only used the first time the component is fetched/injected
exact 👍
👍 1
m
So for subsequent fetches/injections, the parameters are ignored (or even you can not send parameters) and you’ll get the same instance? I wonder about that. Maybe there should be some mechanism to handle when parameters differ from the ones used to build the current available instance.
a
yes, you will get the same object. But this instance already initialized with initial parameters. Also
single
instance could be
scoped
and this could be an instance that can be initiated within scope with specific
parametersOf()