There is a lot in my code Singlelike
Disposable disp = Single.fromCallable(()-> loadData())
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(res-> showInUI(res),
throwable -> Log.e(TAG, throwable.getMessage()))
);
As I understood from the documentation, the difference between Observableand Singleis that Single can respond with an error, never respond, respond with success and emit only once. Now I don’t manage anything, and everything works fine.
So what do I need to do disp.dispose()at all?
source
share