I'm trying to get the latest value of a given Observable
and get it to emit
immediately once it's called. Given the code below as an example:
return Observable.just(myObservable.last())
.flatMap(myObservable1 -> {
return myObservable1;
})
.map(o -> o.x) // Here I want to end up with a T object instead of Observable<T> object
This does not work because by doing this the flatMap
will emit myObservable1
which in turn will have
to emit to reach the map
.
I don't know if doing such a thing is even possible. Does anyone have any clue on how to achieve this goal? Thank you