Created
February 4, 2026 09:01
-
-
Save arnaudgiuliani/c16f10483cabecded2f70903f1e7ec1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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