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?
Francesco Cervone
03/19/2021, 3:22 PM
looks like what I’m looking for is the
onCompletion
extension function…
👌 1
n
Natsuki(开元米粉实力代购)
03/24/2021, 5:10 PM
IMHO i dont think flow can be
unsubscribe
except cancel the subscribe coroutine, correct me if i'm wrong