These are chat archives for ReactiveX/RxJava

28th
Apr 2017
Felix
@fx42
Apr 28 2017 09:51
hey, ive got a short question: when I have an Observable<double[]> , how can I store each value of this array into an List?
jonefee wang
@jonefeewang
Apr 28 2017 11:49
use Observable.toList()
@fx42
Mark Elston
@melston
Apr 28 2017 14:01
@jonefeewang, I would suggest that, since the aim of the saveResult observable is to simply perform a side-effecting operation (you never use the departmentInfo parameter to the lambda), you don't put the saveToCache in a separate Observable. Instead simply put the function call directly in the doOnCompleted as the final operation. It might require some additional refactoring of the chain but that would be cleaner.
Zak Taccardi
@ZakTaccardi
Apr 28 2017 14:31
@fx42 just .map( array -> Arrays.asList(array))
Zak Taccardi
@ZakTaccardi
Apr 28 2017 16:47
I need a "reverse debounce" operator -> I want to emit the first event and skip all events after the first event which occur within a 1 second interval
Zak Taccardi
@ZakTaccardi
Apr 28 2017 17:35
.throttleFirst()^^
Erik Buttram
@erito
Apr 28 2017 17:59
What about something like window(1000, TimeUnit.MILLISECONDS).take(1)?
Zak Taccardi
@ZakTaccardi
Apr 28 2017 17:59
throttle first is simpler, no?
Erik Buttram
@erito
Apr 28 2017 18:00
Ah good catch, didn't know about that operator!