Questions tagged [reactivex]

ReactiveX is a library for composing asynchronous and event-based programs by using observable sequences.

From reactivex.io:

It extends the observer pattern to support sequences of data and/or events and adds operators that allow you to compose sequences together declaratively while abstracting away concerns about things like low-level threading, synchronization, thread-safety, concurrent data structures, and non-blocking I/O.

688 questions
6
votes
3 answers

What are the differences between using a Subject and an Observable, and what are the uses for each?

I have learned of two different ways of making an Observable. First one was with a Subject, like so: // file A const message$ = new Subject(); // file B message$.subscribe( (message) => console.log(message) ); // file C message$.next("Hello…
Sammy I.
  • 2,523
  • 4
  • 29
  • 49
6
votes
3 answers

Zip more than 9 Observables in rxJava

Faced the situation when it is necessary to make 10-12 small parallel queries and combine the results. But if there is a zip method that allows you to combine up to 9 Observables, then how to do more I do not understand. I tried using zip Method…
Андрей
  • 85
  • 1
  • 4
6
votes
1 answer

Operator similar to exhaustMap but that remembers the last skipped value from the source and executes it in the end

I need an operator similar to exahustMap, but which remembers the last skipped observable and executes it after the current observable completes. For example, considering the marble diagram for exhaustMap: In my case, after the blue values are…
Andrei Vajna II
  • 4,642
  • 5
  • 35
  • 38
6
votes
1 answer

rxjs: returning value with pipe(map)

How to return value when using pipe and map, like in this scenario: return this.service.someEvent().pipe( map(x => { return this.service.someValue; }) ) but the value is never returned since never subscrubed to the event, if i use it like…
Igor
  • 247
  • 1
  • 7
  • 16
6
votes
3 answers

RxJs: buffer events when condition is true, pass events through when condition is false

I created the Observable constructor below that works as described. Does anyone know if there is a more concise way of achieving the same behaviour using the operators that come with RxJs? I was looking at bufferToggle which is close to the required…
Sam Herrmann
  • 6,293
  • 4
  • 31
  • 50
6
votes
1 answer

How to handle progress update using ReactiveX Observables/Subjects?

I'm writing an Angular app which uses the ReactiveX API to handle asynchronous operations. I used the API before in an Android project and I really like how it simplifies concurrent task handling. But there is one thing which I'm not sure how to…
TardigradeX
  • 707
  • 11
  • 29
6
votes
3 answers

RxJava2: Alternative to rx.Observable method first(predicate)

I wanted to use RxJava but can't come up with alternative for method public final Observable first(Func1 predicate) in RxJava2. What I want to do is following: return io.reactivex.Observable .concat(source1,…
TheKarlo95
  • 1,144
  • 9
  • 17
6
votes
1 answer

Is it possible to call Rx extension methods with lambdas from inside an IronPython script?

Can someone please explain me this really weird observation? I've been trying to call Rx extension methods from inside IronPython and it is turning out to be simply impossible. I've boiled it down to this simple example: import…
glopes
  • 4,038
  • 3
  • 26
  • 29
6
votes
4 answers

how to pass object to rxjs subscribe() callback function?

I am developing a Ionic2 App, using the cordova-plugin-network-information, I am subscribing to the connect and disconnect events from my app.ts and want to be able to pass a reference to my NavController and a Loading component into the subscribe()…
Will de la Vega
  • 536
  • 1
  • 5
  • 17
6
votes
1 answer

Difference between subscribeNext and bindNext

I am using RxSwift and wondering what is difference between subscribeNext and bindNext? Thanks for your input.
thierryb
  • 3,660
  • 4
  • 42
  • 58
5
votes
1 answer

reactive programming basics during blocking http call

As someone newly investigating reactive programming, I'm having a question seems not answered elsewhere: How does a blocking call (i.e http request from frontend) really utilize this concept? My understanting is this, and question is about…
ayan ahmedov
  • 391
  • 1
  • 5
  • 23
5
votes
2 answers

How to create a Vert.x ReadStream from an InputStream

I would like to stream the stdout of a local process to a Vert.x HttpResponse. To do it I think I have to stream/convert/pipe a java.io.InputStream (which streams the process stdout) to an io.vertx.core.streams.ReadStream and then I can pipe the…
b1zzu
  • 370
  • 4
  • 17
5
votes
2 answers

Rx Operators. Ignore until next is emitted

In my app I have time consuming logic which can be started in many ways, let's say automatically or manually by user. // Let's describe different event sources as relays val autoStarts = PublishRelay.create() val manualStarts =…
pavelkorolevxyz
  • 1,380
  • 2
  • 14
  • 35
5
votes
3 answers

Rxjs - remap object with observables as values

I got an observable like this: const original = Observable.of({ a: this.http.get('https://jsonplaceholder.typicode.com/todos/11'), b: this.http.get('https://jsonplaceholder.typicode.com/todos/22'), c:…
5
votes
2 answers

Why ngFor async pipe needs Observable instead of Observable?

I have the following template: *ngFor="let contact of contacts | async" Where: contacts: Observable; I get this error: ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to…
clemtoy
  • 1,681
  • 2
  • 18
  • 30