Skip to content

Tag: rxjs

capture error from catchError – http.post

component which is calling submitUser Here is the service file with submitUser function and here is the httpService Post and handleError methods handleError adisplays the console error, I am trying to return/capture this error in my submitUser function in service.ts How do i do that ? Any Inputs appreciated, …

How to access array elements in angular

From an API, I’m trying to get data using httpModule. Here is my code When I use async and await, it says that await has no effect. An undefined is getting assigned to the variable this.output. How can I make this work? Also, How can I get access to a variable from the below response array? here I need …

Select ReplaySubject values emitted untill now

Is there reliable solution to get a snapshot of values currently buffered in ReplaySubject? I came up with something like this, but not sure how reliable this solution is: The timer factor above seems wrong to me as I have no warranty if all values have been emitted properly within given time (this applies to…

How to subscribe to date chage with Rxjs

I couldn’t find a “simple” example with Rxjs, demonstrating how we can listen to days changes as an event. for example, let’s say that I have to execute certain methods every time we enter a new day. how can I approach this with the reactive paradigm and subscribe to time events? Answe…

Subject call to next causing a strange error

This causes the following error: Cannot read property ‘length’ of undefined If, however, I wrap msg$.next in a function, then it works without any errors. Lambda function Anonymous function Named function They’re all just wrapper functions that seemingly do nothing but call the next function…