Comments (8)
If you want something like dagger that supports multiplatform 😉 https://github.com/evant/kotlin-inject
from dodoformastodon.
I would recommend, using Koin. It has support for multiplatform
https://insert-koin.io/docs/reference/koin-mp/kmp
from dodoformastodon.
My vote is to use https://github.com/evant/kotlin-inject
It is to the jsr330 spec and works in kmp. Plus Evan is here to do support if it fails
from dodoformastodon.
Should we consider Koin instead? If we truly want to go multiplatform? There are performance tradeoffs between these DI frameworks.
Build times will be faster with Koin but that shouldn't be the sole reason for it... Let's chat more about this
from dodoformastodon.
Hm, Hilt / Dagger would only be possible for Android. But this is a multiplatform project. I personally think the project should just use custom DI. Using the same solution for the whole project, even shared code. With Kotlin's default parameter values it's pretty simple, less overhead.
from dodoformastodon.
I really don't see the benefit of using Koin. You still have to write modules. Kotlin's default parameter values solve 90% of all DI needs imho. In my personal project I was using Koin before, then migrated to custom DI and was saving so much lines of code
from dodoformastodon.
Just have a look here, another project of mine, where I removed Hilt and replaced it with custom DI. Look at how much LOC I could save
from dodoformastodon.
I vote for koin, since it is the solution I had less trouble with in different KMP/KMM project.
from dodoformastodon.
Related Issues (20)
- [FEAT]: Add logger to Network client HOT 1
- [FEAT]: Profile Screen for Dodo
- [FEAT]: Inject Coroutine context into KtorApi client HOT 1
- [FEAT]: Settings and Logout
- [FEAT]: change feedtype to enum HOT 1
- [FEAT]: Create Expect/Actual for Kamel and Scrape.it
- [BUG]: Server selection is broken
- [FEAT]: Share string resources across the platforms
- [FEAT]: 'How to Build' documentation HOT 1
- What's the state of this project? HOT 1
- [FEAT]: Add iOS targets to existing modules HOT 3
- Use objects for namespaces
- [FEAT]: R8/proguard support on Android
- Typos in CONTRIBUTING guide HOT 1
- [FEAT]: Show Open Source Licenses in mobile apps
- [BUG]: ./gradlew installDebug, open the App, it will crashed. HOT 4
- [FEAT]: Make DodoAuthStorageImpl thread safe
- [FEAT]: Move maincontext to default/impl components
- [FEAT]: enhance extraction of oauth query params HOT 1
- [FEAT]: colocate data layer with features HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dodoformastodon.