Questions tagged [rx-kotlin]

RxJava bindings for Kotlin programming language

RxKotlin is open sourced and available under the Apache License, Version 2.0

238 questions
0
votes
1 answer

How can I convert flux element to a key map mono

So I have an object of contactId and I convert it to flux and then I query the contact details using each Id respectively and after that convert it to Mono using collectList method and map it to another object let's call it DomainContactDetails like…
Patrick
  • 734
  • 11
  • 26
0
votes
1 answer

What is the benefit of using RxJava, RxKotlin, or Even Kotlin coroutines instead of Interfaces for On Click listener?

My Question is so clear, I wanna know what is the reason that you prefer using third-party libraries like RxJava or RxKotlin, or using coroutines for setting item click listener for Recyclerview items click, dialogs button or anything else, instead…
0
votes
1 answer

How to doOnNext only consumes the first n items of a PublishSubject?

I have a PublishSubject: val myPublishSubject = remember { PublishSubject.create().apply { doOnNext { Logger.debug(TAG) { "Got new Long $it" } } .takeUntil(someObservable) .subscribe() …
0
votes
1 answer

Applying an operation to all previously emitted items

I have a queue of items that will send once the server is reachable: val queueHistory: Observable A QueuedItem is: data class QueuedItem(val item: Item, val sent: Boolean = false) The queueHistory never completes, it just records when an…
RefuX
  • 490
  • 5
  • 11
0
votes
1 answer

Which is right way to map few server models into one domains?

My server api looks like this: data class ArticleDTO(val id: Int, val title: String, val typeId: Int) data class Type(val id: Int, val name: String) interface API { fun getArticles(): Single> fun getTypes():…
Sergey
  • 113
  • 1
  • 5
0
votes
1 answer

Transform Single>> to Single>

could someone help, please? I have these functions fun getBooks(): Single> { return getCollections() .map { it.map(::collectonToBook) } } fun getCollections(): Single> { return…
mXaln
  • 105
  • 11
0
votes
1 answer

How to perform operation based on result of multiple RxJava Completable results

Have been banging my head over this for a while, I am lost here in managing a requirement where I have to use Rx in Kotlin. Let me explain. There is a set of ids whose equivalent items needs to be deleted from server and eventually in local based on…
Varun Muralidharan
  • 141
  • 1
  • 2
  • 12
0
votes
0 answers

Subscribe with Bind

Hello friends to improve the code below; Is there a way to directly "bind" the "event.position" value without having to subscribe? Or better? var index: BehaviorRelay =…
Mehmet Ceylan
  • 385
  • 1
  • 6
  • 18
0
votes
1 answer

To Kill an Observable

Excuse the pun, had to do it to em. I have an observable that is declared like so: Observable .interval(20, TimeUnit.MILLISECONDS) .subscribe { val timeDiff = System.currentTimeMillis() - testSum Log.i("LOG",…
Jake Choi
  • 121
  • 1
  • 1
  • 6
0
votes
2 answers

Combine 3 single results - one stream

I'm trying to do calculating one by one, asynchronously. fun method1(): Int{ return 2+2 } fun method2(value: Int): Int{ return value * 2 } fun method3(value: Int): Int{ return value * 3 } Now I want method 2 work after method 1 and take result…
discCard
  • 421
  • 1
  • 5
  • 16
0
votes
0 answers

Rx java subscribe 3 times but invocation only 2 times

I believe there is some big gap in my understanding about RxJava suppose we have this interface: interface SecretInterface { fun getSecretKey(): Single } interface Vault { fun openSecret(): Single } and then I have this…
0
votes
1 answer

Update Image width and Margins programmatically

I have a drawable that's being displayed in a layout. The drawable has default properties such as color and width. I'm creating a data class to be able to update those when the recycler view is created. The part that fills in the color in the middle…
0
votes
2 answers

Android line divider

Learning android with a two friends and right now we're focusing on just UI portion. One friend gave us the task of creating a display with dashed line divider. We're trying to add it in the Adapter file so it can be loaded in our fragment as part…
0
votes
1 answer

Using data from another observable

I'm failing to get into the ReactiveX mindset or the codebase I am working in is just poorly written. Suppose I have some Observable A() and I need data from another Observable B() in order to do validation on data coming through A, how do I…
mateo
  • 3
  • 3
0
votes
1 answer

Android KotlinRx API call making continuously in background

I am new to Rx and I am making one API call using Rx. It is working but the problem is that it is continuously making the API after I received response or error. I am using the MVVM pattern. Here is my code how I am observing result in View…
Harsh Shah
  • 2,162
  • 2
  • 19
  • 39