👋 hello, i'm migrating my application from dagger to koin and I am thinking is there a similar solution to dagger Provider<T>? Basically injecting a factory which can create T objects with it's dependencies provided by koin.
s
sloydev
02/18/2019, 2:43 PM
I think you could build it yourself quite easily with something like
Copy code
val myObjectProvider: MyObject
get() = get() //<- the second one is Koin's get() XD
sloydev
02/18/2019, 2:43 PM
it should give you a new instance every time you use it, as long as your dependency is declared as
factory
sloydev
02/18/2019, 2:44 PM
Or use a function instead if you think that using the property could be confusing