Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

rx.Single support for RxTiPresenterUtils #40

Open
iffa opened this issue Nov 23, 2016 · 2 comments
Open

rx.Single support for RxTiPresenterUtils #40

iffa opened this issue Nov 23, 2016 · 2 comments

Comments

@iffa
Copy link

iffa commented Nov 23, 2016

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 -> ()));
@passsy
Copy link
Contributor

passsy commented Nov 24, 2016

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 passsy added the rx label Nov 24, 2016
@iffa
Copy link
Author

iffa commented Nov 28, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

3 participants