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
0
votes
1 answer

Chain of observables with conditions

So I have 3 observables: updateCustomUserData$, updateEmail$, updatePassword$. And profileEditForm. I need to update profile data if appropriate fields of form was changed; I think it should look like this: updateCustomUserData$(data) { return…
0
votes
1 answer

RxJS make multiple AJAX requests then get a new list with another AJAX request

The goal is to make multiple save request and then get a new list using another ajax request. I have the following that appears to be what I want but was wondering if there was a better way of(1,2,3) .pipe( concatMap(vals => vals), …
Rob Stone
  • 3
  • 1
0
votes
1 answer

Rxjs concat map condition check before it go to second call

I want to check first service call result before proceeding further. If the first call fails, I have some thing to handle return this.http.get(this.partySiteAddressUrlOrganization + "?" + new Date().toString(), { params: newparams }).pipe( …
jaffer
  • 13
  • 4
0
votes
2 answers

Why concatMap is not working as expected?

please see my code below import { Observable, interval } from 'rxjs'; import { map, take, mergeMap, concatMap, switchMap, exhaustMap } from 'rxjs/operators'; const frameworks = ['Backbone', 'Angular', 'React', 'Vue']; const getRecruits = agency =>…
nshathish
  • 417
  • 8
  • 23
0
votes
1 answer

Angular HTTP delete request, app updating question

Link to stackblitz editor: https://stackblitz.com/edit/github-krcuye Link to API needed to have full test functionality: https://github.com/TSPeterson206/conspiracyAPI API uses knex and seeds would need to be run via: npm run knex seed:run...due to…
0
votes
1 answer

Angular 8: Breaking down HTTP request instead of sending in a lumpsum

Hi StackOverflow community members, I am working on Angular 8. I have a question on how to breakdown my HTTP request, instead of sending 1000 requests in 1 go, I would like to have something like sending every 50 requests at 1 time only. I couldn't…
0
votes
2 answers

Sending sequential Http Requests using RXJS Observables

I would to have a function which sends an http request to an endpoint giving the list of all items, and then sending a second request to get the first element on that list. The function should return the last item. I'm using the following code but…
Niku Hysa
  • 66
  • 1
  • 12
0
votes
3 answers

How to use the first response from concatMap in the second request

I am trying to avoid the nested subscription in request to the backend. I need to login, then get a service token based on the response of the login, then get a encryption token based on the service token. I have seen about concatMap but i am not…
MaynorSong
  • 630
  • 7
  • 15
0
votes
1 answer

Rxjava2 how to have flatMap emitting items in called order?

Imagining there is Observable A emitting a1, a2, a3, a4... A.flatMap(a -> f(a)) will emit items in unpredictable order, for example: fa3, fa1, fa2, fa4... How could I get results in order like below? fa1, fa2, fa3, fa4... ConcatMap can return…
Hoang Nguyen Huu
  • 1,202
  • 17
  • 17
0
votes
0 answers

concatMap issue in android RXJava

Please follow me, I shall tell what I had done so far in my code. I called the Observable method to get the 9 function to get the values from DB. Now I need to get an additional data from DB. For this I used concatMap method of RXJava. But I get…
Parama Sudha
  • 2,583
  • 3
  • 29
  • 48
0
votes
0 answers

RxJava2 Flowable's concatMap and concatMapEager with observeOn has different behavior

Should publisher.observerOn(scheduler).concatMap(mapper, 1) and publisher.observerOn(scheduler).concatMapEager(mapper, 1, 1) have same behavior when concatMapEager using concurrency with 1? I test concatMap and it may use different thread instead…
koji lin
  • 667
  • 1
  • 8
  • 12
0
votes
0 answers

Sequence of HTTP requests in Angular 6 with RxJS

My objective is to save information in a backend server via POST requests. I need these requests to be executed one by one when the previous one finishes. But I need to add some logic between requests. These requests are made using RxJs…
Facundo Palavecino
  • 181
  • 1
  • 1
  • 6
0
votes
1 answer

RxJS FlatMap and ConcatMap intermediate solution?

I have an application written in typescript using rxjs where im using flatMap to return a list of 5000 observables, but i don't want them all to be subscribed at the same time. I tried to use concatMap but it lets my application very slow, since it…
justcode
  • 1,562
  • 3
  • 14
  • 25
0
votes
2 answers

Detailed example of RxJs concatMap to get a user ID, then query a user with it

Having trouble getting concatMap to make the first query for a user id and then use the id for a second query. This is how how the docs explain its usage but examples demonstrating this working don't seem to…
Ben Racicot
  • 5,332
  • 12
  • 66
  • 130
0
votes
1 answer

Synchronizing different method calls and return response in RxJs

I have one method to fetch Contact data from database. this.getContact("contact"); After getting desired output, I want to put it in Json store with the help of method below: this.local.saveRecord("contact", c); After everything is done,…
Sudipta
  • 3
  • 1