Observable.just (), which returns Unit to Kotlin

I have an Observable snippet that eventually returns an error and retries, or just returns onNext. I don't need anything on onNext, so that’s just it Observable<Unit>.

Now the problem is that at the end of the chain I have to hit this onNext and I have nothing but the old old Observable.just(). But I cannot return Observable.just (null), because it returns Nothing?, not Unit. I can not return Unitbecause it does not work. Therefore, I have Observable.just(null).map{}. It works, but it looks ugly. Any idea for a better solution?

+4
source share
1 answer

Observable.just(Unit). Unit Unit.

+5

Source: https://habr.com/ru/post/1671142/


All Articles