Marcin Moskala’s Post

View profile for Marcin Moskala, graphic

Senior Software Developer

Another common misuse is creating a StateFlow for each call. That makes no sense. We create StateFlow so it can be shared by multiple flows. StateFlow should be stored in a property; only then can it be shared by multiple flows.

  • No alternative text description for this image
Marcin Moskala

Senior Software Developer

3mo

Learn more about how Kotlin Coroutines work and how to use them efficiently from my book, Kotlin Coroutines: Deep Dive, or in my workshop. There is an open edition in October, so register while there are still some places left! https://kt.academy/user/marcinmoskala

Like
Reply
Shah Nizar

Innovative Android Developer | BLE & VoIP Expert | Kotlin Multiplatform Enthusiast

3mo

Is it only me ? Or does anyone else face difficulties to use UseCase approach? I think it causes more complications? Simple MVVM approach is much easier I think..

Malek Chouchene

Ingénieur développement Android

3mo

ShareIn it's for transforming a flow into a sharedFlow , if you want to transform a flow into a stateFlow you should use stateIn .

Like
Reply

Good catch 🪝🫴

Iniyan Murugavel

Lead Android Engineer | 7+ YoE | Kotlin | Jetpack Compose | KMP | Product Enthusiast | Lead with Curiosity Always | Scaling Startups | Ex-Rapido | Ex-KreditBee | Ex-HCL

3mo

Very helpful!

Somia Damlakhi

Software engineer - Senior Android developer - mobile developer - team leader

3mo

Insightful!

See more comments

To view or add a comment, sign in

Explore topics