Skip to main content

All Questions

0 votes
1 answer
437 views

RxJS How to avoid Race operator to cancel "loser" HTTP Request Observable?

I am trying to create a race condition with RxJS where I have to query 2 API, but I only want to load a spinner if the data takes more than 150ms to arrive. So the flow on the UI is: wait for 150ms - ...
floroz's user avatar
  • 413
0 votes
0 answers
49 views

Asynchronous Handling of Observables

I am fairly new to rxjs and reactive programming in general and I have got a fair bit of grey area surrounding the async handling of observables. I have a straight forward scenario with routing a ...
avgs's user avatar
  • 21
3 votes
1 answer
188 views

how switch operator unsubscribing the previous observables?

I am trying to understand observables. When i used switch operator ,i could not understand the line"it unsubscribes the previous observable and subscibes new one" var inp=document.getElementById("i");...
Suraj Prakash Joshi's user avatar
20 votes
3 answers
13k views

RxjS shareReplay : how to reset its value?

I use shareReplay to call only once (like a cache) a webservice to retrieve some informations : In my service : getProfile(): Observable<Customer> { return this.callWS().pipe(shareReplay(1)...
Jscti's user avatar
  • 14.5k
2 votes
1 answer
5k views

Can we use async/await with RxJS Pattern?

I have the following scenario. If the users enter in the route with only /lobby without an ?competitionId= I must search on the state the favorite competition of the user. After receive the favorite ...
Antonio Mayrinck Moura's user avatar
0 votes
2 answers
41 views

How to make sure that a function returns after an async block has been executed?

I'm working with Angular 4.2.4 / RxJS 5.4.2, and I'm trying to use a service method to retrieve some data and assign that data to a property in my component: component: ngOnInit() { this....
Lual's user avatar
  • 3,198
13 votes
3 answers
28k views

How to collect array of emitted values from Observable.from?

So in Rxjs, I have bunch of code, return Observable.from(input_array) .concatMap((item)=>{ //this part emits an Observable.of<string> for each item in the ...
tomriddle_1234's user avatar
6 votes
2 answers
10k views

ReactiveX Observable from NodeJS Express 'post'

Is it possible to create an ReactiveX Observable from: app = express(); app.post('/path', function() {...}) ? I mean, there exists a way to create an observable fromEvent in which I already used for ...
user avatar
4 votes
2 answers
2k views

rxJs callback with observable being asynchronous

I have a map operation in my rxjs flow streaming.map((data) => { //example async call methodCall.then((response) => { return data.test }) }) .filter((value) => ...); The thing is ...
MilindaD's user avatar
  • 7,653
0 votes
1 answer
78 views

RxJS asynchronous handling of streams

//app.js import $ from 'jquery'; import Rx from 'rxjs/Rx'; var $pull = $('#fetch');//this is a button id var pull$ =Rx.Observable.fromEvent($pull,'click').startWith("/hcdata.json"); var $result = $("...
user avatar
4 votes
1 answer
2k views

concat: how to handle each subscribe with a specific next function as independent

I'd like to handle the response of each subscribe independently in a concat observable. I'm using Rxjs 5 in angular2. let source1 = //some Http service let source2 = //some Http service let source3 = ...
M. Carlo Bramini's user avatar
0 votes
1 answer
2k views

Observable Race Condition, how to time two Observables correctly

I have an obeservable sequence, where each time a call release event occurs I map that event to an http request that returns a callog json Array. I need to combine the value emitting form the call ...
TimCodes's user avatar
  • 365
2 votes
2 answers
2k views

How to count Observable on incomplete sequence in Rx.js

I have an obeservable sequence, where each time a call realease event occurs I map that event to an http request that returns some call logs that I then filter and need to get a count form. The ...
TimCodes's user avatar
  • 365
1 vote
1 answer
642 views

Web scraper iterating over pages with Rx.js

About a month ago I built this web scraper using Async / Await as a async way of collecting info for a web scraper. I'm trying to build that very same scraper again using Rx.js. I've read through the ...
ThomasReggi's user avatar
  • 59.8k
1 vote
3 answers
3k views

Accumulating and resetting values in a stream

I'm playing with Reactive Programming, using RxJS, and stumbled upon something I'm not sure how to solve. Let's say we implement a vending machine. You insert a coin, select an item, and the machine ...
kangax's user avatar
  • 39.2k

15 30 50 per page