Skip to content

Instantly share code, notes, and snippets.

@arnaudgiuliani
Created February 4, 2026 09:01
Show Gist options
  • Select an option

  • Save arnaudgiuliani/c16f10483cabecded2f70903f1e7ec1a to your computer and use it in GitHub Desktop.

Select an option

Save arnaudgiuliani/c16f10483cabecded2f70903f1e7ec1a to your computer and use it in GitHub Desktop.
// DSL — now with compile-time auto-wiring
val appModule = module {
    single<Database>()
    single<UserRepository>()
    viewModel<MainViewModel>()
}
// Or Annotations — same power
@Singleton
class UserRepository(private val database: Database)
@KoinViewModel
class MainViewModel(private val repository: UserRepository) : ViewModel()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment