https://kotlinlang.org logo
#coroutines
Title
# coroutines
r

rocketraman

12/01/2023, 7:12 PM
Should https://kotlinlang.org/docs/shared-mutable-state-and-concurrency.html be updated to include a
MutableStateFlow
option with
update
?
Copy code
var counter = MutableStateFlow<Int>(0)

fun main() = runBlocking {
    massiveRun {
        counter.update { it + 1 }
    }
    println("Counter = ${counter.value}")
}
👍 1