Open boris-petrov opened 8 months ago
can you cook up a small example?
import java.util.concurrent.Callable;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Single;
public class Test {
public static <T> Observable<T> lazilyGetObservable(Callable<Observable<T>> callable) {
return Single
.fromCallable(callable)
.flatMapObservable(observable -> observable);
}
}
P.S. That needs the io.reactivex.rxjava3:rxjava:3.1.9
library.
RxJava
has its own concept of Function. And has functions that use it. We can't usejava.util.Function.identity()
there unfortunately. Butfb-contrib
gives a warning.