---
title: "#kotlin-flow articles | Hashnode"
description: "Explore 55 articles tagged #kotlin-flow on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/kotlin-flow"
---

Tag

# #kotlin-flow

55 posts · 7 followers

[Android Expert](https://hashnode.com/@android-expert) · [Nov 2](https://hashnode.com/posts/why-your-flow-refuses-to-hop-threads-context-preservation-flowon-and-channelflow-in-kotlin/6ae8a26f660b8eb5185b74b4)

### [Why Your Flow Refuses to Hop Threads: Context Preservation, flowOn, and channelFlow in Kotlin](https://android-expert.hashnode.dev/why-your-flow-refuses-to-hop-threads-context-preservation-flowon-and-channelflow-in-kotlin?utm_source=hashnode&utm_medium=feed)

Why withContext breaks flow { } in Kotlin. Learn context preservation, when to use flowOn or channelFlow, and the Android failures that crash apps.

11 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/why-your-flow-refuses-to-hop-threads-context-preservation-flowon-and-channelflow-in-kotlin?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 2](https://hashnode.com/posts/dropped-on-the-floor-conflation-in-kotlin-flows-and-the-ui-events-you-never-saw/6ae88d60c9a2b6f165a55f3f)

### [Dropped on the Floor: Conflation in Kotlin Flows and the UI Events You Never Saw](https://android-expert.hashnode.dev/dropped-on-the-floor-conflation-in-kotlin-flows-and-the-ui-events-you-never-saw?utm_source=hashnode&utm_medium=feed)

Learn how Kotlin Flow conflation drops events in StateFlow, SharedFlow, and collectLatest, and fix it with Channels, buffers, and tested patterns.

11 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/dropped-on-the-floor-conflation-in-kotlin-flows-and-the-ui-events-you-never-saw?utm_source=hashnode&utm_medium=feed)

[kigya](https://hashnode.com/@kigya) · [May 2](https://hashnode.com/posts/dont-bury-your-backing-properties/69f5d44b0ab374db99e15bc8)

### [Don't Bury Your Backing Properties](https://kigya.hashnode.dev/dont-bury-your-backing-properties?utm_source=hashnode&utm_medium=feed)

Learn why explicit backing fields do not fully replace backing properties and asStateFlow for safer ViewModel state in Kotlin Android apps.

12 min read · [kigya.hashnode.dev](https://kigya.hashnode.dev/dont-bury-your-backing-properties?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Feb 21](https://hashnode.com/posts/chapter-30-usecase27-flow-cancellation-cooperative-cancellation/6999ddbd1ea55229dbb50438)

### [Chapter 30 : UseCase27 - Flow Cancellation & Cooperative Cancellation](https://kotlinflow.hashnode.dev/chapter-30-usecase27-flow-cancellation-cooperative-cancellation?utm_source=hashnode&utm_medium=feed)

Flow cancellation is not an optional feature. It is a core part of how coroutines are designed to behave. When a collector stops collecting, the entire upstream flow is cancelled automatically. This i

6 min read · [kotlinflow.hashnode.dev](https://kotlinflow.hashnode.dev/chapter-30-usecase27-flow-cancellation-cooperative-cancellation?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Feb 21](https://hashnode.com/posts/chapter-29-usecase26-channels-and-flow-bridge/6999a568649f185d24e98f46)

### [Chapter 29 : UseCase26 - Channels and Flow Bridge](https://kotlinflow.hashnode.dev/chapter-29-usecase26-channels-and-flow-bridge?utm_source=hashnode&utm_medium=feed)

Now we do one level below Flow. Flow is built on coroutines.Coroutines are built on channels. Here we convert channel to Flow and build Flow using channelFlow. We also understand producer-consumer in

4 min read · [kotlinflow.hashnode.dev](https://kotlinflow.hashnode.dev/chapter-29-usecase26-channels-and-flow-bridge?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Feb 20](https://hashnode.com/posts/chapter-27-usecase24-stateflow-state-holder-semantics/699893302de7857aa67d3417)

### [Chapter 27 : UseCase24 - StateFlow (State Holder Semantics)](https://kotlinflow.hashnode.dev/chapter-27-usecase24-stateflow-state-holder-semantics?utm_source=hashnode&utm_medium=feed)

What is StateFlow? StateFlow is a special type of SharedFlow that: Always holds a current value Requires an initial value Replays the latest value to new collectors Conflates updates automatically

3 min read · [kotlinflow.hashnode.dev](https://kotlinflow.hashnode.dev/chapter-27-usecase24-stateflow-state-holder-semantics?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Feb 20](https://hashnode.com/posts/chapter-28-usecase25-hot-vs-cold-flow-comparison/699894629333793b50d6ea84)

### [Chapter 28 : UseCase25 - Hot vs Cold Flow comparison](https://kotlinflow.hashnode.dev/chapter-28-usecase25-hot-vs-cold-flow-comparison?utm_source=hashnode&utm_medium=feed)

In this use case we will do an architectural level comparison of hot versus cold flow. CODE IMPLEMENTATION package org.kotlinflowlearner.stockflow.usecases.uc25 import kotlinx.coroutines.flow.\* impor

4 min read · [kotlinflow.hashnode.dev](https://kotlinflow.hashnode.dev/chapter-28-usecase25-hot-vs-cold-flow-comparison?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Feb 19](https://hashnode.com/posts/chapter-26-usecase23-sharedflow-hot-streams/699757f940a5f60bf0153abf)

### [Chapter 26 : UseCase23 - SharedFlow (Hot Streams)](https://kotlinflow.hashnode.dev/chapter-26-usecase23-sharedflow-hot-streams?utm_source=hashnode&utm_medium=feed)

Everything that we have seen until now was cold flows. Now we enter the world of "hot” flows. Cold flow means: Nothing runs until collected Each collector gets its own independent execution Flow re

4 min read · [kotlinflow.hashnode.dev](https://kotlinflow.hashnode.dev/chapter-26-usecase23-sharedflow-hot-streams?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Feb 19](https://hashnode.com/posts/chapter-25-usecase22-context-switching-with-flowon/6997577230fd04958d5bed74)

### [Chapter 25 : UseCase22 - Context Switching with flowOn](https://kotlinflow.hashnode.dev/chapter-25-usecase22-context-switching-with-flowon?utm_source=hashnode&utm_medium=feed)

In this chapter we answer the core question : If Flow is sequential, then how do we control which thread executes which part? That’s what flowOn does. Flow is context-preserving by default. It means t

2 min read · [kotlinflow.hashnode.dev](https://kotlinflow.hashnode.dev/chapter-25-usecase22-context-switching-with-flowon?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Feb 18](https://hashnode.com/posts/chapter-24-usecase21-conflation-deep-dive/6996056cb989a0d19d2be09d)

### [Chapter 24 : UseCase21 - Conflation Deep Dive](https://kotlinflow.hashnode.dev/chapter-24-usecase21-conflation-deep-dive?utm_source=hashnode&utm_medium=feed)

buffer() in Chapter 23 was all about “queue everything” when the consumer is slow. Now we look into conflate() which is all about “dropping intermediate values” and caring only about the latest value. The Core Idea When the consumer is slow: buffer(...

3 min read · [kotlinflow.hashnode.dev](https://kotlinflow.hashnode.dev/chapter-24-usecase21-conflation-deep-dive?utm_source=hashnode&utm_medium=feed)
