https://kotlinlang.org logo
#rx
Title
# rx
o

orafaaraujo

12/02/2019, 8:19 AM
Hi, everyone Is possible to replace my
PublishSubject
to
Flow
, or
BroadcastChannel
or something more Kotlin-ish way? Thank you
a

alexsullivan114

12/02/2019, 2:33 PM
I'm sure there's a channel that maps directly to
PublishSubject
the way
ConflatedBroadcastChannel
maps to
BehaviorSubject
p

Paul Woitaschek

12/02/2019, 4:03 PM
I don't think so ^^
t

thymecypher

12/09/2019, 8:43 PM
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

alexsullivan114

12/09/2019, 9:03 PM
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

thymecypher

12/09/2019, 9:11 PM
I’m terrible at Rx and only recently tried Flow but it felt a lot simpler in practice compared to Rx.
a

alexsullivan114

12/10/2019, 2:12 PM
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
5 Views