arnaud.giuliani
08/20/2018, 9:12 AMbj0
08/27/2018, 10:18 PMBenoit Duffez
08/30/2018, 7:15 PM// Facvtory instance of Presenter
chrisjenx
09/02/2018, 3:59 PMarnaud.giuliani
09/03/2018, 12:58 PMHiosdra
09/05/2018, 6:30 AMAntoineJojo
09/11/2018, 1:28 PMinject()
with a generic type?
For instance: class BaseActivity<P: BasePresenter> { val presenter: P by inject() }
tapchicoma
09/13/2018, 12:23 PMloadProperties = true
to startKoin()
Paul Woitaschek
09/15/2018, 4:36 PMPaul Woitaschek
09/16/2018, 5:08 AMpavlospt
09/19/2018, 6:30 AMpavlospt
09/19/2018, 6:32 AMesdudnik
09/20/2018, 3:33 PMtestOptions {
unitTests {
includeAndroidResources = true
}
}
all of my tests crashed with strange errors.
From the beginning I received
org.koin.error.AlreadyStartedException: Koin is already started. Run startKoin only once or use loadKoinModules
and when I added
testImplementation 'org.koin:koin-test:1.0.0'
I received error
java.lang.NoSuchMethodError: org.koin.standalone.StandAloneContext.startKoin$default(Lorg/koin/standalone/StandAloneContext;Ljava/util/List;ZLjava/util/Map;ILjava/lang/Object;)Lorg/koin/Koin;
I extend my test classes from AutoCloseKoinTest() but errors stay the same.
Do anybody faced this problem? Or probably somebody know how to fix it.
I will appreciate any help.orafaaraujo
09/24/2018, 7:42 PMBroadcastReceiver
?hmole
09/25/2018, 11:19 AMkotlin-multiplatform
plugin)ritesh
09/26/2018, 11:32 AMritesh
09/26/2018, 1:53 PMarnaud.giuliani
09/26/2018, 7:30 PMscope
definition tied to the same scope Idarnaud.giuliani
10/01/2018, 11:45 AMcheckModules
function from koin-test
to check your modules treeelifarley
10/03/2018, 12:32 PM2018-10-03 09:31:10:604 (KOIN)::[i] [PrintLogger] display debug = true
2018-10-03 09:31:10:616 (KOIN)::[i] [context] create
2018-10-03 09:31:10:726 (KOIN)::[i] [module] declare Single [name='ISimpleDataSourceFactory',class='jdbc.ISimpleDataSourceFactory']
2018-10-03 09:31:10:726 (KOIN)::[i] [module] declare Single [name='DataSource',class='javax.sql.DataSource']
2018-10-03 09:31:10:728 (KOIN)::[i] [module] declare Single [name='ServerConfig',class='org.http4k.server.ServerConfig']
2018-10-03 09:31:10:728 (KOIN)::[i] [module] declare Single [name='SteelheartRestClient',class='stht.client.SteelheartRestClient']
2018-10-03 09:31:10:738 (KOIN)::[i] [module] declare Single [name='customer',class='klib.db.SimpleObjectSessionFactory']
2018-10-03 09:31:10:742 (KOIN)::[i] [module] declare Single [name='CustomerService',class='stht.service.CustomerService']
2018-10-03 09:31:10:748 (KOIN)::[i] [module] declare Single [name='app.routes',class='kotlin.jvm.functions.Function1']
2018-10-03 09:31:10:749 (KOIN)::[i] [module] declare Single [name='Http4kServer',class='org.http4k.server.Http4kServer']
2018-10-03 09:31:10:749 (KOIN)::[i] [modules] loaded 8 definitions
2018-10-03 09:31:10:749 (KOIN)::[d] [modules] loaded in 53.834704 ms
2018-10-03 09:31:10:750 (KOIN)::[d] Koin started in 136.243142 ms
2018-10-03 09:31:10:779 (KOIN)::[i] +-- 'org.http4k.server.Http4kServer'
2018-10-03 09:31:10:779 (KOIN)::[d] |-- [Single [name='Http4kServer',class='org.http4k.server.Http4kServer']]
2018-10-03 09:31:10:784 (KOIN)::[i] | +-- 'kotlin.jvm.functions.Function1'
2018-10-03 09:31:10:795 (KOIN)::[d] | |-- [Single [name='app.routes',class='kotlin.jvm.functions.Function1']]
2018-10-03 09:31:10:796 (KOIN)::[i] | | +-- 'stht.service.CustomerService'
2018-10-03 09:31:10:797 (KOIN)::[d] | | |-- [Single [name='CustomerService',class='stht.service.CustomerService']]
2018-10-03 09:31:10:797 (KOIN)::[i] | | | +-- 'klib.db.SimpleObjectSessionFactory'
2018-10-03 09:31:10:797 (KOIN)::[d] | | | |-- [Single [name='customer',class='klib.db.SimpleObjectSessionFactory']]
2018-10-03 09:31:10:797 (KOIN)::[i] | | | | +-- 'javax.sql.DataSource'
2018-10-03 09:31:10:797 (KOIN)::[d] | | | | |-- [Single [name='DataSource',class='javax.sql.DataSource']]
2018-10-03 09:31:10:800 (KOIN)::[i] | | | | | +-- 'jdbc.ISimpleDataSourceFactory'
2018-10-03 09:31:10:800 (KOIN)::[d] | | | | | |-- [Single [name='ISimpleDataSourceFactory',class='jdbc.ISimpleDataSourceFactory']]
2018-10-03 09:31:10:830 (KOIN)::[e] Error while resolving instance for class 'jdbc.ISimpleDataSourceFactory' - error: org.koin.error.BeanInstanceCreationException: Can't create definition for 'Single [name='ISimpleDataSourceFactory',class='jdbc.ISimpleDataSourceFactory']' due to error :
Can't find property 'db.driver'
klib.db.DataSourceKitKt$dsModule$1$1.invoke(dataSourceKit.kt:34)
Jemshit Iskenderov
10/05/2018, 1:33 PMViewModel#onCleared()
(not Activity lifecycle)
Aim: ViewModel injects UseCaseA
and UseCaseB
, and both use cases inject RealTimeConnection
interface. Implementation of RealTimeConnection
injects ClassC
. I want RealTimeConnection
implementation and ClassC
to be created only once in ViewModel scope.
I have tried:
module("app") {
scope(SCOPE_VM) {
ClassC()
}
scope(SCOPE_VM) { RealTimeConnectionImplementation(get()) as RealTimeConnection }
factory { UseCaseA(get()) } // parameter is RealTimeConnection
factory { UseCaseB(get()) } // parameter is RealTimeConnection
}
Question: i can not inject UseCaseA
and UseCaseB
from constructor of ViewModel because scope is created in init{}
block of ViewModel. I can not use by inject, get<>
inside ViewModel. What is the solution? ThanksJemshit Iskenderov
10/05/2018, 2:16 PMby inject()
if i implement KoinComponent
. Is this the right way?Jason
10/06/2018, 2:38 PMVinicius Carvalho
10/09/2018, 2:35 PMKodeinAware
classes to inject it. Is it possible to have access to the Application
instance from my managed instances in koin?rezenebe
10/10/2018, 9:29 PMrezenebe
10/12/2018, 3:13 PMval testRemoteRepository by inject<ConfigDatasource>()
I'm getting an "unresolved reference" on ConfigDataSource which is 95% similar to the example. There is no red or missing dependencies in my code, any idea on where to start debugging this?
I was trying to write checkModule Tests, but I can't get that far w/ ConfigDataSource compile time issuesrezenebe
10/12/2018, 10:21 PMval remoteDatasourceModule = module {
single { createOkHttpClient() }
single { createWebService<ConfigDatasource>(get(), getProperty(DatasourceProperties.SERVER_URL)) }
single { ConfigRepositoryImpl(get()) as ConfigRepository }
}
object DatasourceProperties {
const val SERVER_URL = BuildConfig.BASE_URL
}
This seems to work just fine when I hardcode the SERVER_URL otherwise i get "Can't find property"Albert
10/18/2018, 8:48 AMsingle
module {
single("foo") { Repository<Foo>() }
single("bar") { Repository<Bar>() }
}
val fooRepo: Repository<Foo>() by inject("foo")
val barRepo: Repository<Bar>() by inject("bar")
Is there an alternative that I could use inject()
(without key) instead of making the injector aware what the key should be?Efe
10/19/2018, 8:08 AMcjmartinkoski
10/25/2018, 7:45 PM