Hi everyone. I have a `MutableStateFlow` and I nee...
# flow
f
Hi everyone. I have a
MutableStateFlow
and I need to know when collectors subscribe/unsubscribe to/from this flow. I see the
fun SharedFlow<T>.onSubscription
extension which invokes the callback when the flow starts to be collected but I can’t find any extension function to know when a collector cancels the subscription. I’m basically looking for the equivalent of RxJava doOnSubscribe and doOnDispose. Does anyone know if there is a way to know when a collector cancels its subscription?
looks like what I’m looking for is the
onCompletion
extension function…
👌 1
n
IMHO i dont think flow can be
unsubscribe
except cancel the subscribe coroutine, correct me if i'm wrong