These are chat archives for ReactiveX/RxJava

26th
Sep 2018
k.watanabe
@hackugyo
Sep 26 2018 05:36
Thanks I will try! @ibaca
Essentially, what suppress warnings in your suggestion is adding the disposable to class-scope (or, activity-scope) disposable list, I think. RxLifecylce will manage disposables, so perhaps what I need is just a trivial extension methods:
    @SuppressWarnings("CheckReturnValue")
    fun <T> Maybe<T>.subscribeSilently(onSuccess: (T) -> Unit): Disposable? {
        return subscribe(onSuccess)
    }
Ignacio Baca Moreno-Torres
@ibaca
Sep 26 2018 06:33
@hackugyo In our case, we add the Observable itself to de lifecycle manager, and it is the manager the responsible of subscribing it when the phase start, and unsubscribe it on finish, so for example if you add an observable to the method onResume(observable) (added one time, recommended to do it in the activty constructor), it will subscribe it in onResume phase, and unsbuscribe it on onPause, this will allow to add some retry to the observable and to caught and handle errors a bit more specific than with the global handler. But yep, to just avoid the warning your solution is easier :+1: