The simplest solution would be to use
RxBindings
library made by Jake Wharton which allows you to simply
RxView.clicks(button)
Otherwise, if you don't want to add any external library you could write your own implementation of the
clicks
method which would based on the
PublishSubject
.
I'm not exactly sure how you should handle errors because it's based on the architecture that you are using. Personally, I'm using MVI and handling errors in the presenter/business layer.
Personally, I think that handling call by
onErrorReturn
is quite correct. You can add mapper for certain type of errors and then it's only a single method call inside error handler.
Also, wouldn't say that making a new subscribtion for each button press is a good practice.