Va Fu
11/26/2017, 12:08 AMVa Fu
11/26/2017, 6:40 PMDiefferson
12/20/2017, 12:59 PMhoang
12/31/2017, 10:40 AMarnaud.giuliani
01/08/2018, 8:59 AMthemishkun
02/23/2018, 7:56 AMelifarley
02/25/2018, 12:04 PMMultiton
option in Kodein. Also, does it allow you to have other ways of providing dependencies like refSingleton(softReference) or eagerSingleton ? Thanks!elifarley
02/26/2018, 10:00 PMCan't create bean Bean[class=connectors.PanthroClient] due to error: Cyclic dependency detected while resolving class kotlin.Function1
. Any hints off the top of your heads?rellenberger
03/02/2018, 10:53 PMmgrzechocinski
03/12/2018, 8:14 AMget()
to inject one implementation. Frankly, I haven’t yet tried to use get()
when there are >1 interface implementations in the grapharnaud.giuliani
04/17/2018, 5:13 PMcristiangm
04/21/2018, 3:36 PMdpreussler
04/21/2018, 5:23 PMrealsoc
04/30/2018, 7:15 PMandre.artus
05/06/2018, 12:53 AMarnaud.giuliani
05/11/2018, 6:59 AMAntoineJojo
05/14/2018, 3:53 PMcketti
05/17/2018, 11:32 AM// In the Activity
val viewModel: MyViewModel by viewModel(parameters = { mapOf("itemId" to R.id.whatever) })
// In the Koin module
viewModel { MyViewModel(get<MyRepo>(), it.values["itemId"] as Int) }
andre.artus
05/29/2018, 4:18 AMmodel = getViewModel(parameters = { mapOf("itemId" to itemId) })
I'm sharing the viewmodel with the detail fragment so that (in theory) it only needs to load once.
I tried
model = getSharedViewModel()
But it fails with:
Caused by: org.koin.error.BeanInstanceCreationException: Can't create bean Factory[class=za.co.ruggedmobile.petermetertest.ui.meters.MetersViewModel, binds~(android.arch.lifecycle.ViewModel)] due to error :
kotlin.TypeCastException: null cannot be cast to non-null type <http://kotlin.Int|kotlin.Int>
arnaud.giuliani
06/13/2018, 7:56 AMBernardo Ferrari
06/18/2018, 6:00 PMarnaud.giuliani
06/19/2018, 8:34 AMarnaud.giuliani
06/23/2018, 8:07 AMarnaud.giuliani
07/02/2018, 9:22 AMinject()
and get()
function to help you inject instancestapchicoma
07/11/2018, 7:44 AMOkHttpClient
declared in base network module, then in new koin modules that requires this client it will be imported from dagger. Eventually only base dependencies will be imported from dagger and then they can be moved in Koin. I think such approach should work.mgrzechocinski
07/13/2018, 7:11 PMThe dependency injection API has been reviewed to allow you to use destructured declaration directly, without forcing you to use a Map of valueSeems like I missed paranthesis in lambda arg. This compiles:
factory { (activity: FragmentActivity) -> PermissionManager(activity) }
@arnaud.giuliani Isn’t it missing in the docs example as well: https://beta.insert-koin.io/docs/1.0/documentation/reference/index.html#_injection_parameters?
val myModule = module {
single{ view : View -> Presenter(view) } // should be: single{ (view : View) -> Presenter(view) }
}
tapchicoma
07/18/2018, 6:14 PMreleaseContext()
not actually removes module, but rather drops all single {}
instancesbachhuberdesign
07/24/2018, 1:56 PMdebug()
function?arnaud.giuliani
08/06/2018, 6:29 AMarnaud.giuliani
08/09/2018, 12:52 PMarnaud.giuliani
08/09/2018, 12:52 PMFarzad
08/09/2018, 2:53 PMcloseKoin()
function call before starting it and moved it from main()
to Application.module()
and it worksarnaud.giuliani
08/10/2018, 6:45 AM