https://kotlinlang.org logo
#rx
Title
# rx
n

Nikola Milovic

02/26/2020, 9:25 AM
Hey guys, quick question. Where should I dispose of a disposable observer if i am not using it in neither activity nor viewmodel/ fragment etc. Instead I am using it in my backend. There is no onclear, ondestroyed nor anything. I only have a
Copy code
val observer = object : DisposableObserver<DrillsType>() {

            override fun onError(e: Throwable) {
                Log.d("TAG", "error " + e.message)
            }

            override fun onNext(data: DrillsType) {
                //onnext
            }

            override fun onComplete() {
                Log.d("TAG", "COMPLETE")
            }
        }
        remoteDataSource.loadDrillTypes().subscribeWith(observer)
    }
It should be disposed when it's all finished. Can I dispose of it in the onComplete perhaps 😂?
p

pg

02/26/2020, 10:09 AM
n

Nikola Milovic

02/26/2020, 10:24 AM
Thank you it seems that is what I am looking for! I'll check it out 😄
🤗 1
4 Views