koin
kotlinx.coroutines
Our great sponsors
koin | kotlinx.coroutines | |
---|---|---|
16 | 59 | |
8,580 | 12,680 | |
1.0% | 0.9% | |
9.2 | 8.9 | |
about 15 hours ago | 2 days ago | |
Kotlin | Kotlin | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
koin
-
Best Practices When Splitting Compose Functions Into Separate Files
Might want to tell koin that : https://insert-koin.io/
To use the viewModels across all screens I use dependency injection by Koin. However Google promotes Hilt, I think that is the golden standard at this point. Both frameworks support creating viewModels with a navigation back stack entry as viewModelStoreOwner.
-
KVision 6.0.0 is released
New modules allow you to easily build KVision apps with the Ballast opinionated application state management framework. You can see how Ballast (together with Koin) can help you design your application architecture in the new todomvc-ballast example.
-
Multiplatform dependency injection libraries equivalent to Dagger/Anvil
I started looking into using Kotlin/JS, and hopefully reusing a bit of code that I have, which is using Dagger and Anvil - which of course are JVM only. So I've been looking for other solutions, namely Koin and Kodein. Koin's multibinding support is... not really amazing (e.g. here, and while Kodein does support multibinding, it doesn't seem to support things like that at the declaration site - everything needs to be specified in a "DI container" (module).
-
Best libraries for Android Developers
Koin
-
Do we really need to use Dependency Injection Framework?
Now I will finish up saying Hilt is just an opinionated way to dependency injection on Android, but there are simpler frameworks out there such as Koin or Kodein that can help take away a lot of the troubles that can come when you try to make your own framework. Just know that most other frameworks tend to be runtime injection instead of compile time injection like Hilt, which can be helpful to know at compile time if you are missing a dependency in your graph as opposed to runtime when its out in the wild.
-
Can someone suggest a simple dependency injection library for TypeScript/JavaScript?
I've been using Angular a lot and I like how it works. I'm also a huge fan of koin for kotlin.
-
A Kotlin programmer's approach to microservices?
for injection, I suggest Koin (https://insert-koin.io/)
-
View Model Doesn’t Have To Depend on ViewModel
It'd be great if it worked
-
Kotlin Team AMA #3: Ask Us Anything
For DI take a look at Koin. It's a pragmatic lightweight dependency injection framework for Kotlin developers with multiplatform support. PeopleInSpace sample project uses it.
kotlinx.coroutines
-
Reactive Backend Applications with Spring Boot, Kotlin and Coroutines (Part 2)
Kotlin has coroutines that are supported by the language and implemented by a library (the implementation remains platform-dependent): kotlinx.coroutines and a sandbox environment is available here to try it out.
- Kotlinx Coroutines for Kotlin 1.7.x
-
Why no one recommends the use of the standard library's Result class but a custom sealed class approach?
Sure! runCatching catches Throwable right? Well when you cancel a coroutine it throws a CancellationException and this gets used as a signal to stop execution. runCatching stops that signal so the coroutine keeps running. Lemme find you a link real quick https://github.com/Kotlin/kotlinx.coroutines/issues/1814
-
Is there thread switching when moving from Default dispatcher to IO dispatcher using withContext?
According to the author of kotlinx.coroutines lib, it will try to keep the same thread if possible but not always. After my question, he updated the document of Dispatchers.IO to be like this https://github.com/Kotlin/kotlinx.coroutines/pull/3236/files This dispatcher and its views share threads with the [Default][Dispatchers.Default] dispatcher, so using `withContext(Dispatchers.IO) { ... }` when already running on the [Default][Dispatchers.Default] dispatcher typically does not lead to an actual switching to another thread. In such scenarios, the underlying implementation attempts to keep the execution on the same thread on a best-effort basis.
I think it is a great question and you can ask it on github
This is the issue I posted in GitHub https://github.com/Kotlin/kotlinx.coroutines/issues/3234 Thank you for the suggestion
-
Am I on the right track?
DI: Dependency injection: Check out Dagger Hilt, Koin or Kodine. Architecture: Android tends to be MVVM but, MVP, MVI and some others exist. Async calls: For kotlin, coroutines. Rxjava can be used with kotlin or java. I'm not actually sure how java devs do asyn calls these days.
-
Build, Test and Deploy your Android Application📱 with GitHub Actions 🤖
Kotlin based, Coroutines + Flow for asynchronous.
-
Java Virtual Threads Preview
Interestingly, Kotlin Coroutines have been available and in production for a LONG time now.
https://github.com/Kotlin/kotlinx.coroutines
In fact, Kotlin Coroutines are an brilliant on the android platform. We are talking severely memory and CPU constrained architectures here.
That said, Kotlin Coroutines are popularly used in production on server side - https://vertx.io/docs/vertx-lang-kotlin-coroutines/kotlin/
So here's the thing - I would doubt anyone would switch to Java Virtual Threads anytime soon.
-
Need Help Testing Callback Style Code with Coroutines
Anyways, it seems like it's a common enough issue that it is getting the attention of the kotlin team. I have high hopes for this PR that looks like it might be close to merging, and has activity within the last couple of days.
What are some alternatives?
Kodein - Painless Kotlin Dependency Injection
kotlin-guice - Guice DSL extensions for Kotlin
injekt
spring-fu - Configuration DSLs for Spring Boot
kotlin-coroutines - Examples for coroutines design in Kotlin
kotlin - The Kotlin Programming Language.
kapsule - Minimalist dependency injection library for Kotlin.
compose-multiplatform - Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
Decompose - Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing (navigation) and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.)
kotlin-guiced - Convenience Kotlin API over the Google Guice DI Library
Katana - Lightweight, minimalistic dependency injection library for Kotlin & Android
kotlinx.serialization - Kotlin multiplatform / multi-format serialization