These are chat archives for ReactiveX/RxJava

3rd
Jun 2017
Mark Elston
@melston
Jun 03 2017 17:47
I posted a question to StackOverflow last Sunday but haven't got any responses to it there. It was framed in a Rx.NET setting but a RxJava solution would be helpful as well.

It relates to removing repeated regions from a stream of data. TakeUntil won't work since it stops the stream after the first sentinal value and I just want to filter out data between every pair of sentinal values.

Any ideas how to do this in RX?

Heikki Vesalainen
@hvesalai
Jun 03 2017 18:34
@melston you can do it with scan, can't you
Heikki Vesalainen
@hvesalai
Jun 03 2017 18:55
yourPublisher.scan('b', (s, v) -> if (v == 'a' || v == 'b' || s != 'a') v else s).filter(v -> v != 'a' && v != 'b');
(edited my answer above)
Heikki Vesalainen
@hvesalai
Jun 03 2017 19:09
@melston also posted it to stackoverflow
Mark Elston
@melston
Jun 03 2017 21:48
Thanks, @hvesalai . I wasn't aware of how Scan worked so I completely bypassed it in my search. I think that will do nicely.