Are there operators in RxJava that perform different functions based on conditions?
PHPz
PHPz 2017-05-16 13:34:43
0
1
846

Rxjava newbie, I searched and found no relevant operators (I just didn’t find them)

I want to judge the obtained data in onNext.
Refresh different interfaces according to the type carried by the activity to the data. The current method is to onNextswitch + case The code is ugly.
I would like to ask if there is such an operator? (I thought about it and it seems that I can actively throw an exception, but this is not good)

PHPz
PHPz

学习是最好的投资!

reply all(1)
Peter_Zhu

No, such logic needs to be written by yourself. You can extract the processing of different types into a separate method, which is easy to call and very concise.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template