Hi, everyone Is possible to replace my `PublishSub...
# rx
o
Hi, everyone Is possible to replace my
PublishSubject
to
Flow
, or
BroadcastChannel
or something more Kotlin-ish way? Thank you
a
I'm sure there's a channel that maps directly to
PublishSubject
the way
ConflatedBroadcastChannel
maps to
BehaviorSubject
p
I don't think so ^^
t
From what I’m gathering, Flow can replace Rx but it’s not the same style as Rx.
So while you should be able to do everything in Flow you did in Rx, it’s done so differently that not everything is a “replace x with y”
a
Really? It's pretty similar...there's a few differences (no Singles/Maybes/Completables so way less flatMapping) but other than that it's a very similar concept
t
I’m terrible at Rx and only recently tried Flow but it felt a lot simpler in practice compared to Rx.
a
I think that's because you need less stuff in most Flow chains. I.e. you can usually get away without `observeOn`/`subscribeOn`, you don't need to
flatMap
nearly as much (probably almost never for most peoples use cases), and terminal operators behave in a synchronous manner - i.e.
first
just gives you the first item rather than some
Single
or something