Skip to content
Advertisement

Tag: rxjs

How to detect changes in child component with respect to changes in the base component – Angular

I have a component profile.component.ts in which there’s a variable, this.candidate, which subscribes to and gets updated like this This component acts like a base component and there’s a child component that extends this component, Now I want to have another variable in this child component that updates itself whenever this.candidate gets updated in the base component. Something like this:

Identify origin of an observable event on subscription

I have a BehaviorSubject<Array<user>> (userListSub$) state that is updated from various places. For example, when I click Follow on a user when I click Unfollow on a user when I favorite a user The same state is being subscribed in different components. I would like a particular component to not react to an event emitted by the state (userListSub$) if

await operator is being skipped

Could you please help me with an issue I am facing? I have attached my code below, after button click, it catches an error (if there is) but skips Which means it just jumps to catch (e). I need it to reload my grid first. Thank you for any advise. Answer If it skips over your code like that, chances

avoid nested subscribe if there is a forkjoin inside

Here is my code in angular So there are many levels of subscribe. Not only it is ugly also the result is wrong and I can’t not find it out by debugging. How can I rewrite it with rxjs operators? Answer You can simplify it using the RxJS operators, like the following: Note: To handle the memory leaks, it’s highly

Angular-Listening to store changes & emit a value from a Service component to a different component – only after Service completes certain operations

Here we have to classes GetDataAsyncService which waits for change in the store (and not executes the block of code under it until a change in the store ( this.getDataAsyncService.getAsyncData().subscribe((data)=>{ )}). When it is called from MainComponent it will get return of(propA); (from GetDataAsyncService) before the block of code in the listener is executed – because the listener is still

RxJS – Processing HTTPrequests in sequence

I’m currently trying to process HTTP Post requests in sequence, additionally trying to repeat each failed request until it succeeds (that is a requirement) and then and only then to continue with processing other requests. My code looks like this for now (it not working as it should, retryWhen is not used properly, I am aware of that, it’s used

Advertisement