Skip to content

Instantly share code, notes, and snippets.

@raghunandankavi2010
Last active December 30, 2018 01:16
Show Gist options
  • Save raghunandankavi2010/548d2e81dcd73172c7605cfba4bc120f to your computer and use it in GitHub Desktop.
Save raghunandankavi2010/548d2e81dcd73172c7605cfba4bc120f to your computer and use it in GitHub Desktop.
Koin
val applicationModule = module {
single<RetrofitInterface>("Retrofit") { RetrofitDependency() }
single<raghu.me.myapplication.di.ListRepository>("ListRepository"){ ListRepositoryImpl(get("Retrofit")) }
// ListScreenViewModel
viewModel { ListScreenViewModel(get("ListRepository")) }
}
// constructor injection of repository in viewmodel and retrofit in repository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment