Relative Content

Tag Archive for javascriptangularrxjs

Rxjs observer un-subscription in angular

I am creating a rxjs Subject inside a angular component and creating a subscription to that Subject in that component itself.
In that case, is the following statement correct

RXjs in angular is making mutiple api calls while using Interval and api calls keeps on multiplying it

I have 2 API calls say FirstApi and SecondApi. First Api provides output with 3 different status(complete,failed, inprogress).
When the user redirects to the page on Complete state and Failed state both API needs to be called once.
when status is Inprogress the SecondApi needs to be called every 30 seconds. The thing to be noted is that FirstApi status keeps on changing is that first it will be in progress for around 40 mins then status changes . so until the status changes from inprogress to comple we need to keep on calling on interval based as output of second APi is depent on the first api. tried setinterval did not work used rxjs did not work. Please provide the solutions.