MviBasePresenter depends on RxJava2 and only use Observables. Should we support Flowable too? #187

Closed
sockeqwe opened this Issue Jan 8, 2017 · 3 comments

Projects

None yet

3 participants

@sockeqwe
Owner
sockeqwe commented Jan 8, 2017

MviBasePresenter.intent(Observable) and MviBasePresenter.subscribeViewState(Observable) are using Observable type. Should we also add MviBasePresenter.intent(Flowable) and MviBasePresenter.subscribeViewState(Flowable).

Having both is awkward. I think most UI related stuff is fine with "just" Observable and converting Flowable to Observable with Flowable.toObservable() should not be a problem.

Otherwise we should use Flowable only (instead of Observable).

Any thoughts? Any RxJava 2 experts that could help with their opinion?

@sockeqwe sockeqwe added this to the 3.0 milestone Jan 8, 2017
@wrparrish

I think you are on the right track, which is leaving the developer to handle Flowable.toObservable() and keeping mosby cleaner, by just providing the Observable return types. That being said, i am not super familiar with MVI, but have been using mosby (Thanks for your work!) for around 18 months or so.

@mkoslacz

Actually, I don't think that GUI will ever generate such number of events that will need handling backpressure, so imho Observable is good enough. That's even covered in the RxJava 2.0 docs here. Correct me please if there is some other scenario of feeding Presenter from view than simple GUI events. Anyway, if such exotic case exists, one could use Observable to Flowable conversion in this rare case. Well, that's exactly what previous posters said.

@sockeqwe
Owner

Thanks for your feedback @wrparrish and @mkoslacz . I will follow your advice and "only" support Observable type.

@sockeqwe sockeqwe closed this Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment