-1
  • in angular app i have load dashboard component and i have implemented statics api

  • when page refresh API call one time after some time (estimate 2 minute) i have click view and go back again click view and go back do this action some

  • we noticed one API calling multiple time in one component (many api called from another component) from this child component

  • please suggest some solution like in react we use memo() function to protect re-rendering or callback and use memo

  • 1
    Without sample of code it is difficult to say, but I think you forgot to unsubscribe your Observables after leaving a component. You should the ngOnDestroy implentation and unsuscribe all your periodic api calls https://stackoverflow.com/questions/38008334/angular-rxjs-when-should-i-unsubscribe-from-subscription – Q.Rey Aug 24 '23 at 12:13
  • yes its right, we asked this qustion on google and chat gpt but issue not solved and code sample is very big due to different component and many apis so can you please connect me vakaliyamuzahid31@gmail.com – Muzahid Vakaliya Aug 25 '23 at 13:22
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 26 '23 at 11:13

0 Answers0