ThirtyInch icon indicating copy to clipboard operation
ThirtyInch copied to clipboard

rx.Single support for RxTiPresenterUtils

Open iffa opened this issue 7 years ago • 2 comments

Most of my data is returned as Singles instead of Observables, so having Single support built-in for RxTiPresenterUtils would be great.

I can of course work around this limitation by simply doing this:

categoryService.getMainCategories()
    .toObservable()
    .compose(RxTiPresenterUtils.deliverLatestToView(this))
    .subscribe(categories -> ()));

iffa avatar Nov 23 '16 23:11 iffa

Sounds useful. Although deliverLatestToView doesn't make a lot of sense because it's only one event. deliverToView should be enough.

Alternatively you could use the new sendToView() method

categoryService.getMainCategories()
    .subscribe(categories -> {
            sendToView(view -> view.show(categories));
    }));

passsy avatar Nov 24 '16 10:11 passsy

Seems reasonable enough, slight oversight on my part not to notice the deliverToView method at all.

iffa avatar Nov 28 '16 16:11 iffa