Emirhan Emmez
11/30/2021, 12:32 PMsingle<UserDataSource> { UserDataSourceImp() }
single { UserController(get()) }
Is anyone get this error about koin di?Nikky
11/30/2021, 12:33 PMUserController
needs a UserDataSourceImp
and not a UserDataSource
try single { UserController(get<UserDataSource>()) }
just to figure out if thats the issueEmirhan Emmez
11/30/2021, 12:40 PMNikky
11/30/2021, 1:05 PMsingle<UserDataSource> { UserDataSourceImp() }
you tell koin to "store" the Imp
as the interface, so when it looks for the specific class.. it failsclass UserController(private val userDataSource: UserDataSource)
and it will start working.. and you can use whatever implementation satisfies the interface UserDataSource
Emirhan Emmez
11/30/2021, 1:26 PMsingle { UserController(get()) }
line