Questions tagged [concatmap]

concatMap is a function from RxJava library, which returns a new Observable that emits items resulting from applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then emitting the items that result from concatinating those resulting Observables.

concatMap is a function from RxJava library, which returns a new Observable that emits items resulting from applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then emitting the items that result from concatinating those resulting Observables.

67 questions
2
votes
1 answer

Chaining multiple observables with different emission types

I'm trying to figure out how to chain to observables together. I have an existing method: public static Observable getData(). In my other class I have this existing code:…
b.lyte
  • 6,518
  • 4
  • 40
  • 51
1
vote
1 answer

ConcatMap with CombineLatest creating more calls than expected

I have an ngrx action/effect that takes a FileList and uploads them sequentially to the server. After the first File is uploaded, an ID will be generated that needs to be used by the second File as argument, so it can be later related to the first…
Luis Lavieri
  • 4,064
  • 6
  • 39
  • 69
1
vote
1 answer

RxJs concatMap is emitting only one http stream out of many

I have been trying to get stream of objects in a sequencial order, however concatMap is not working for me. With mergeMap I get the stream but no in a sequencial order. Below is my code I am trying: this.result .pipe( map((result:…
mohit
  • 1,878
  • 1
  • 16
  • 27
1
vote
1 answer

concatMap is not subscribing for the second time

I am implementing concatMap operator. Even before doing that I tried making two subscriptions one after the other and it worked. The first subscription is made to the input field of form and the second subscription is made for the http request.…
Eranki
  • 750
  • 1
  • 11
  • 30
1
vote
3 answers

RxJs: multiple requests followed by one request via concatMap not working

I make an api call which returns an array. I need to loop over this array and perform a new request per item. The following code works fine: return this.expeditionService.getTranssmartBookingXml(request).pipe( concatMap((response) => { return…
Robin
  • 421
  • 1
  • 6
  • 21
1
vote
1 answer

How to use check condition with in concatMap/switchMap in angular 7

I Am trying to download a pdf form API response. API-1 will return the file name, with the filename as input to the API - 2, I will download the pdf. It works well for positive cases. If incase there is no fileName returned from API - 1, I should…
FE-Deve
  • 13
  • 3
1
vote
1 answer

How to avoid nested subscriptions with concatMap in Angular

I get an array of products with this code proyecto$:Observable this.proyecto$=this.http.get(`${this.urlProyecto}/${this.proyectoId}`) .pipe( map(p => { id: p.id, descripcion: p.name, …
kintela
  • 1,283
  • 1
  • 14
  • 32
1
vote
0 answers

Flux.concatMap going to next event before returning the result

I have a Flux of test case objects, for each object, I need to call an external service, once a service response is received, in the next operation, it checks if the response is valid or not. But randomly for a few objects, before the response is…
Umesh
  • 13
  • 2
1
vote
2 answers

How do I subscribe in sequence and return only the value from the last observable in RxJS?

I'm in an Angular route resolver and want to return an observable. I need to subscribe to multiple async processes in order: A => B(a) => C(b) C depends on B and B depends on A. A must complete, then B, then C, but I only want the value from C to be…
jkyoutsey
  • 1,969
  • 2
  • 20
  • 31
1
vote
3 answers

RxJs Angular multiply sync http webcalls

I have to make multiply sync webcalls, one after another if it's status is ok. Horrible, but working code: this.api.post1().subscribe((data: any) => { if (data.status== 'OK') { this.api.post2().subscribe((data: any) =>…
Alex
  • 39
  • 1
  • 8
1
vote
3 answers

RxJS | How do I catch and fail within a pipe using concatMap?

I am trying to use concatMap to allow me to run requests in a sequential order without having to visually subscribe to every request that I am sending. Everything is working fine, however when there is an error it carries on running through the…
user8116198
1
vote
1 answer

Angular 6 + RxJs - Error handling for concatMap

I'm still learning RxJs, and I'm trying to use concatMap() to NOT use nested subscriptions. I want the first call to run and then delay for a second or two (creating a database record before the second request) before running the second request. I…
RoboBear
  • 5,434
  • 2
  • 33
  • 40
1
vote
1 answer

How to send request sequently with checks before each request?

I need: send N requests sequently (I use concatMap to do this) only if object is valid (I extend concat map with validation code) stop queue on first error (by server error response or by client check rejection) Now the code is look like: ids =…
Sharikov Vladislav
  • 7,049
  • 9
  • 50
  • 87
1
vote
0 answers

Android rxJava perform operation on results coming from Observable (map, flatMap, concatMap)

Possible Duplicate RxJava performing operation on a list and returning an observable I am very new to rxJava. What I want to achieve is to get data from Database as ArrayList and perform some operation on each item of ArrayList. I want to do all…
Nouman Bhatti
  • 1,777
  • 4
  • 28
  • 55
1
vote
2 answers

Duplicate calls when using concatMap

I want to display in a view the next upcoming event a user is registered to. To do so I need first to retrieve the closest event (in time) the user is registered to and then retrieve the information of this event. Has the list of event a user is…
Manuel RODRIGUEZ
  • 2,131
  • 3
  • 25
  • 53