Questions tagged [rx-kotlin2]

RxKotlin 2 is a library that adds convenient extension functions to RxJava.

RxKotlin 2 is a lightweight library that adds convenient extension functions to RxJava 2 (see ). It can be found at https://github.com/ReactiveX/RxKotlin

106 questions
0
votes
4 answers

How to unsubscribe from Flowable in RxKotlin/RxJava?

I am using Room with RxJava/RxKotlin Flowable following this article. I got it running but the got issue using it with ViewPager with 3 fragments. I will walk you through my code little bit: I have a viewpager with tab layout and three fragments(A,…
hasn
  • 749
  • 6
  • 21
0
votes
0 answers

RxJava / RxKotlin - andThen still executing if previous step fails. How to stop?

I'm new to RxJava and am having a hard time with handling error cases. The application is in Kotlin but it probably won't make much of a difference. The scenario is basically user authentication and then performing an action but if the user is not…
Rig
  • 1,276
  • 3
  • 22
  • 43
0
votes
1 answer

Rx Kotlin/Java Observable on state

Is any way to create an RxJava2 Observable to notify state changes? like: private var internalState = "state1" val state: Observable = Observable(...) ... fun updateState(newState: String) { ... } // !!! attention: I need to notify all…
Hossain Khademian
  • 1,616
  • 3
  • 19
  • 29
0
votes
1 answer

RxJava2 onNext() called multiple times?

I have a method that returns an Observable like this: open fun get(): Observable { return if (condition) getDataFromApi() else getDataFromDb() } and is subscribed as followed: get() …
Navdroid
  • 1,541
  • 3
  • 25
  • 52
0
votes
1 answer

RxKotlin repo gradle build compilation fails with gradle 4.7 (JDK 1.8)

I tried the following: $ git clone https://github.com/ReactiveX/RxKotlin.git $ cd RxKotlin/ $ gradle build It fails with: ...FAILURE: Build failed with an exception. Where: Build file '/home/myuser/RxKotlin/build.gradle' line: 13 What…
0
votes
1 answer

How can you create a timer that works on a List in Rx?

I want to look for an entire list of items to be found before I complete and if that entire list isn't found, then an exception (a Timeout or custom one) is to be thrown. Like the built in Observable.timer() but instead of the test passing once the…
user443654
  • 821
  • 1
  • 7
  • 21
0
votes
1 answer

RxObservable that repeats itself until an expected value is found

The goal of this function is to create a stream that emits values periodically until it encounters one that matches a predicate. Here is some skeleton code that I've come up with: class Watcher( /** * Emits the data…
Allan W
  • 2,791
  • 4
  • 23
  • 41
0
votes
0 answers

RxJava2 and Kotlin : OnErrorNotImplementedException

I'm using RxJava2 with Kotlin. I don't know why but I always have this error : io.reactivex.exceptions.OnErrorNotImplementedException: An operation is not implemented: not implemented So I add to my subscriber the onError callback, but now I have…
Romain Caron
  • 257
  • 1
  • 3
  • 15
0
votes
1 answer

Is RxKotlin Depend upon RxJava in Android?

Can I use Rx Kotlin + Rx Android without adding Rx Java? Or Rx Kotlin is depended upon Rx Java.
Hafiz Waleed Hussain
  • 1,062
  • 12
  • 25
0
votes
1 answer

RxKotlin with Socket.io in Android

What I trying to do is listen to socket data and convert into an observable string that my UI can Subscribe this event and do Change on UI So far I created a class SocketConnection maintain in dagger connection happen properly and received data and…
Rupesh
  • 51
  • 2
  • 10
0
votes
1 answer

For-loop with RxJava2 or RxKotlin

I want to build a async operation that iterates chars in given string. I have a char array taken by "mystring".toCharArray(). I want to iterate each 10th character by using RX. I know i can do it with AsyncTask and for-loops but i thought RX would…
Emre Aktürk
  • 3,306
  • 2
  • 18
  • 30
0
votes
1 answer

rxkotlin groupby is not working

could you please help me to group by the following json and return a hashMap in kotlin based on date with RxKotlin? is so easy with just kotlin but really stuck for Rxkotlin. thanks val groupedTransactions = accountTransactions.transactions …
0
votes
1 answer

RxJava/RxKotlin split stream depending on subtype

I have a stream of ResponseMessage which can be of different subtypes. I would like to split the stream into streams where I can handle each type in its own stream. My first try resulted in this which I can not see working out. file.readLines() …
user3139545
  • 6,882
  • 13
  • 44
  • 87
0
votes
2 answers

Cannot zip Rxjava Observables

I am using RxJava 2.* and I want to merge the results of two observables (one from retrofit and another from room) by using zip operator(feel free to suggest better). Model objects that come from remote server are different from the one coming out…
erluxman
  • 18,155
  • 20
  • 92
  • 126
0
votes
1 answer

RxJava2: onComplete not called with flatMapIterable

Here is short snippet of code: val subject = BehaviorSubject.createDefault(emptyList()) subject.onNext(Arrays.asList(1, 2, 3)) subject.flatMapIterable { list: List -> list } .subscribeBy( onNext…
Ivan Sadovyi
  • 168
  • 1
  • 15