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
1
vote
1 answer

RXKotlin Break Inside doOnNext and Call Another Function

i am using rx kotlin newly and didn't understand all of it yet. I am trying to loop over a list of queries, and execute them one by one. in this list i have a special string that once reached, i want to break the loop and perform another…
Rashad.Z
  • 2,494
  • 2
  • 27
  • 58
1
vote
2 answers

Reuse part of RxJava stream

Probably an rx newbee question. If I have two rx streams, which have some common parts, is there a possibility to extract and to reuse them? Here is pseudo code example: someManager.getInfo(id) returns a Single This fun takes an id and…
Tima
  • 12,765
  • 23
  • 82
  • 125
1
vote
1 answer

RxJava: Create items in list and return new list

Rx noobie here: any idea on how to achieve this?: I have a list of items from the UI and would like to POST them to the server. I need the list of POSTed items back from the server (to use the server-issued IDs, timestamps etc). Pardon my long…
kip2
  • 6,473
  • 4
  • 55
  • 72
1
vote
3 answers

rx - Conditional flatMap / add condition to flowable boolean

I need to show error view if status is error and call.isEmpty() returns true. Is there a better way to achieve this result? val errorVisible = states.asFlowable() .map { it.status == Status.ERROR } .flatMap { isError -> if (isError)…
alashow
  • 2,735
  • 3
  • 21
  • 47
1
vote
1 answer

OnBackPressed doesn't work when observe EditText KEys

I have Extension of EditText where I'm listenig to events from keyboard of EditText. I need to know when user press any button for showing (or not showing) error. So I make Observable for keys (rxbinding2) and I'm getting any press but when I press…
ivanovd422
  • 357
  • 5
  • 18
1
vote
1 answer

How to Force Vertx Rx CodeGen To Generate MayBe As Return Type

I am using following Kotlin code to generate proxy (This will also generate Rx methods) @ProxyGen @VertxGen interface JobService { @Fluent fun getCertain(jobId: Int, handler: Handler>): JobService } When I see generated Rx…
1
vote
1 answer

Error: None of the following functions can be called with the arguments supplied when converted to Kotlin from Java

I have seen other questions here related to this error but still not able to fix. Plus I'm asking this question because unlike other questions here, I'm getting this error only when I convert the code to Kotlin from Java. I'm using this same RxJava…
Gissipi_453
  • 1,250
  • 1
  • 25
  • 61
1
vote
0 answers

Kotlin Generic List Parsing

I was looking other questions but this one is using a different method. I’m using MVVM in my Android app. Actually this is the way that I’m getting data from my server: Inject dataManager into viewModel. viewModel calls…
1
vote
1 answer

Idiomatically creating hot observables with BehaviorSubject in RxKotlin / RxJava

Currently I'm building a project in Kotlin using RxKotlin. My background with Rx is primarily grounded in RxJS. A pattern I would regularly use for creating hot observables in Typescript would look something along the lines of this: private…
Devon Germano
  • 171
  • 12
1
vote
2 answers

RXKotlin Lambda Understanding

This never completes: Completable.complete() .andThen{ Completable.complete() } .test() .assertComplete() This does complete: Completable.complete() .andThen(Completable.complete()) .test() …
Thomas Cook
  • 4,371
  • 2
  • 25
  • 42
1
vote
1 answer

Generic Function References in Rx and Kotlin -- type inference failed

I am writing a method in Kotlin: fun fetchDepositSession(): Completable = Observable.fromIterable(session.accounts) .map(DepositSession::DepositAccount) .toList() …
user2836797
1
vote
1 answer

Combine two subject only when one changes and get latest from other

Im stuck getting the following example working as expected, I have tried using zip and combineLatest and as show below withLatestFrom however non of them gives the expected output. @Test fun thereCanBeOnlyOne() { val s1 =…
user3139545
  • 6,882
  • 13
  • 44
  • 87
1
vote
1 answer

Adding subscribeOn() is changing return type of observable

I've encountered a strange problem which I'm struggling to understand. I have written some code that creates an observable from callable. It compiles fine, but as soon as I specify a scheduler for it it changes the return type and doesn't…
Thomas Cook
  • 4,371
  • 2
  • 25
  • 42
1
vote
1 answer

How can I conditionally add an asynchronous operation in the middle of an RxJava stream?

Here's a simplified version of what I'm trying to do (using Kotlin and RxJava) makeServerCall() .doOnNext { doStuff(it) } //TODO: if it == 0, call asyncOperation() and wait for its…
Chad Schultz
  • 7,770
  • 6
  • 57
  • 96
1
vote
2 answers

Asynchronous call for every item inside a collection

I have a problem which I was unable to solve so far I'm new to RxKotlin so it might be easy. Please have a look at the code: override fun infos(): Stream = client.infoAboutItem(identifier) .map { …
John Smith
  • 844
  • 8
  • 26