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

Maciek

03/17/2020, 5:51 AM
Hey guys, I want to send stream of data from one class to the other (adapter/viewholder to activity). Previously I'd use RxJava's Subject for it, what would be recommended way of achieving this with flow? I see how I could do it with channels but it's hard for me to wrap my head around the flow for such use cases
Should I use something like this?
a

Abhishek Bansal

03/18/2020, 3:46 AM
BroadcastChannel
is the closest thing to
PublishedSubject
here. you can use
openSubscription
for receiving events at runtime, but don’t forget to cancel the subscription once you are done.
👍 1
m

Maciek

03/18/2020, 6:43 AM
thanks!
5 Views