fully hides the underlying mutable shared flow from consumers
👍 3
t
Tolriq
11/17/2020, 1:31 PM
Thanks, so exposing as SharedFlow for something that is 100% internal is not an error, it's just better habit to use the other one to avoid future possible troubles.
w
wasyl
11/17/2020, 1:35 PM
Yep both will behave the same, just using
asSharedFlow
is imo good practice. Even if you don’t develop a library, it’s still good to make it impossible to make a mistake by fellow devs — I can imagine someone doing
if (someFlow is MutableSharedFlow) someFlow.castAndSend(x)