Morning! How do you access to Koin Context from an...
# koin
s
Morning! How do you access to Koin Context from an extension? Looks a lil' bit weird do somwthing like
KoinJavaComponent.get()
and too verbose to do a
StandAloneContext.getKoin().koinContext.get()
, there are other options?
s
hum, thanks! Looks good! 👍
I was thinking about the performance, how much it costs to create a new component every time I want to inject an object from a non koin context? We did this simple solution:
Copy code
inline fun <reified T : Any> getFromKoin(): T {
  return KoinJavaComponent.get(T::class.java)
}
@arnaud.giuliani what do you think?
a
it’s quiet direct to call an object, what is your point here?