gabrielfv
05/12/2020, 2:12 PM.subscribe()
would make sense, but if the request fails for some reason the app crashes because there is no onError
handling. However, if I give it something so that it feels it has error handlung, like .subscribe({ }, { })
, I'll be passing on indirect reference to the enclosing class, which would prevent it from being garbage collected until the request returned.
Is there some sort of standard way of acting on such scenario?Zach Klippenstein (he/him) [MOD]
05/12/2020, 3:56 PMonErrorResume(empty())
before your subscribejw
05/12/2020, 4:16 PMActions.empty()
or whatever it's calledgabrielfv
05/12/2020, 5:07 PMempty()
either to subscribe()
or onErrorResume()
I'll solve my problem without leaking references. That's neat, gonna do that.Single.just(Unit)
because it was a Single
, which admits no empty()
state. Little less neat, works nonetheless