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

Mouaad

05/10/2020, 2:56 PM
Hi folks,
MutableStateFlow
interface documentation says:
Copy code
A mutable [StateFlow] that provides a setter for [value] and a method to [close] the flow.
However, I can’t see any
close
method! I am missing something ?
o

octylFractal

05/10/2020, 3:03 PM
No, I don't think you are -- you should file an issue
s

streetsofboston

05/10/2020, 3:12 PM
It doesn't need a close. It is still a
Flow
which don't need a close either. The lifecycle of the Flow (and MutableStateFlow) is determined by the collector (the CoroutineScope in which
collect
is called)
o

octylFractal

05/10/2020, 3:13 PM
well, then the documentation should be updated to reflect that fact -- either way an issue needs to be filed
s

streetsofboston

05/10/2020, 3:16 PM
Ah yup, the doc needs to change.
m

Mouaad

05/10/2020, 3:32 PM
Thanks for your responses. I filed an issue for it: https://github.com/Kotlin/kotlinx.coroutines/issues/2007
e

elizarov

05/10/2020, 6:28 PM
Thanks! That’s a leftover from the draft PR.
👍🏼 2