InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
https://insert-koin.io
Apache License 2.0
9.08k stars 719 forks source link

Add new KoinApplication Composable #1704

Closed Bloemcol closed 1 year ago

Bloemcol commented 1 year ago

Context

After using the KoinApplication Composable in a different project, it felt weird to me that you need a lambda to provide the modules to your Koin application.

This new Composable only requires a list of modules to work, making it just a bit easier to use.

Note

⚠️ Warning: light mode screenshots ahead!

I did not use hyphens in the JavaDoc comment, as the docs are easier on the eye without them. Compare the JavaDoc hover preview in Android Studio of the KoinApplication Composable mentioned above

Screenshot 2023-11-11 at 09 03 20

with the new one.

Screenshot 2023-11-11 at 09 03 34
arnaudgiuliani commented 1 year ago

hello and thanks for your proposal. I finally kept only KoinApplication with application definition. The idea of the function is to start a Koin context. Let's keep the standard way to do. If after 3.5.2 you see any improvement to bring, feel free to reopen a proposal.