Make sure to update your StateFlow safely in Kotlin!

Patryk Kosieradzki
ProAndroidDev
Published in
3 min readJul 25, 2021

--

Photo by Matt Hardy on Unsplash

Hi, today I come to you with a quick tip on how to update your StateFlows safely in Kotlin.

Recently a new version of Kotlin Coroutines library was released with a few new extensions functions to help you with StateFlow updates. It all started with this issue:

--

--

Senior Android Engineer @ Moss, Podcaster @ AndroidTalks, based in Warsaw, Poland