tapchicoma
10/25/2018, 7:59 PMsloydev
10/26/2018, 11:17 AMamatkivskiy
10/29/2018, 2:06 PMmkporwit
10/30/2018, 1:10 AM// Service interface
interface Service{
fun doSomething()
}
// OtherService interface
interface OtherService {
fun doOtherThing()
}
// Service Implementation
class ServiceImp() : Service, OtherService {
fun doSomething() { ... }
fun doOtherThing() { ... }
}
How could I write my module definition such that the single
ServiceImpl
is bound to both Service
and OtherService
?amatkivskiy
10/30/2018, 4:16 AMo.semen
10/31/2018, 2:37 PMclass PWApp: Application() {
private val appModule = module {
single<AuthRepository> { SecureAuthRepository(get()) }
}
override fun onCreate() {
super.onCreate()
Stetho.initializeWithDefaults(this)
startKoin(this, listOf(appModule))
}
}
but it can not resolve reference for join()
. Android Studio does not suggest any imports so I looked up examples and copy/pasted imporr from there:
import org.koin.android.ext.android.inject
But this method does not suits my case:
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline fun <reified T : Any> ComponentCallbacks.inject(name: String = ..., scope: Scope? = ..., noinline parameters: ParameterDefinition /* = () -> ParameterList */ = ...): Lazy<AuthRepository> defined in org.koin.android.ext.androidI have no idea what to try next. Could someone please help me with this ?
liminal
11/01/2018, 3:40 PM.addCallback(object : RoomDatabase.Callback() { override fun onCreate(db: SupportSQLiteDatabase) ... }
. So by the time I needed to use the data inserted, it was there. With Koin, my DB is declared as a bean
and it gets created lazily so first time I access the database, 0 items is returned, coming back to that screen again renders all of the items. I tried initializing the DB in my Application.onCreate() but the the database's onCreate() does not get called. Any ideas what can be done? My thinking is I need to somehow create the database and its data before it's first accessed (as opposed to how Koin is designed to access dependencies lazily when they are needed by that particular screen). I doubt this part is relevant but I use Google Arch Paging component to load data.Soundlicious
11/03/2018, 11:00 AMarnaud.giuliani
11/07/2018, 8:25 AMarnaud.giuliani
11/07/2018, 8:26 AMarnaud.giuliani
11/09/2018, 8:58 AM1.0.2
published 🚀 - changes available here: https://github.com/InsertKoinIO/koin/blob/master/CHANGELOG.mdarnaud.giuliani
11/09/2018, 3:08 PMAllan Wang
11/11/2018, 7:32 AMBenoit Duffez
11/13/2018, 5:35 AMritesh
11/13/2018, 8:06 AMritesh
11/13/2018, 11:45 AMtwisterrob
11/14/2018, 11:38 AMMarkchous
11/14/2018, 3:54 PMarnaud.giuliani
11/15/2018, 3:24 PMwilliam
11/23/2018, 9:25 PMarnaud.giuliani
11/24/2018, 10:01 AMarnaud.giuliani
11/26/2018, 8:04 AMAlice
11/26/2018, 1:25 PMarnaud.giuliani
11/27/2018, 8:38 AMsmassive
11/28/2018, 11:00 AMsanogueralorenzo
11/30/2018, 1:32 PMSergio Crespo Toubes
12/02/2018, 8:35 PMpresenter.attachView(this)
arnaud.giuliani
12/17/2018, 8:02 AMnwh
12/20/2018, 7:24 PMCan't access ViewModels from detached fragment
EDIT: I fixed it by using by viewModel()
instead of = getViewModel()
widar
12/24/2018, 8:12 AMorg.koin.error.AlreadyStartedException: Koin has already been started!
Has anyone seen this before? 🙂widar
12/24/2018, 8:12 AMorg.koin.error.AlreadyStartedException: Koin has already been started!
Has anyone seen this before? 🙂org.koin.error.BeanOverrideException: Try to override definition with Single [name='SomethingProvider',class='some.SomethingProvider'], but override is not allowed. Use 'override' option in your definition or module.
onTerminate()
in my Application class and call stopKoin()
from there. It seems to work fine! I hope this is a somewhat acceptable way of doing itmgrzechocinski
12/25/2018, 5:16 PMwidar
12/30/2018, 3:26 PMJohannes Waltsgott
01/02/2019, 10:41 AMAutoCloseKoinTest
?